├── .gitignore ├── .vscode └── launch.json ├── CamlJs.nuspec ├── LICENSE ├── README.md ├── dist ├── camljs.d.ts └── camljs.js ├── examples ├── spAddIn │ ├── .vs │ │ ├── CamlJS │ │ │ └── v15 │ │ │ │ └── Server │ │ │ │ └── sqlite3 │ │ │ │ ├── db.lock │ │ │ │ └── storage.ide │ │ └── config │ │ │ └── applicationhost.config │ ├── CamlJS.sln │ ├── CamlJs.SharePoint │ │ ├── AppManifest.xml │ │ ├── CamlJs.SharePoint.csproj │ │ ├── Data │ │ │ ├── DataInstance │ │ │ │ ├── Elements.xml │ │ │ │ └── SharePointProjectItem.spdata │ │ │ ├── Elements.xml │ │ │ ├── Schema.xml │ │ │ └── SharePointProjectItem.spdata │ │ ├── Elements.xml │ │ ├── Features │ │ │ └── MainFeature │ │ │ │ ├── MainFeature.Template.xml │ │ │ │ └── MainFeature.feature │ │ ├── Images │ │ │ ├── AppIcon.png │ │ │ ├── Elements.xml │ │ │ └── SharePointProjectItem.spdata │ │ ├── Package │ │ │ ├── Package.Template.xml │ │ │ └── Package.package │ │ ├── Pages │ │ │ ├── Default.aspx │ │ │ ├── Elements.xml │ │ │ └── SharePointProjectItem.spdata │ │ ├── Scripts │ │ │ ├── Elements.xml │ │ │ ├── SharePointProjectItem.spdata │ │ │ ├── camljs.js │ │ │ └── vkbeautify.js │ │ ├── SharePointProjectItem.spdata │ │ └── packages.config │ └── packages │ │ ├── CamlJs.2.8.2 │ │ ├── CamlJs.2.8.2.nupkg │ │ └── content │ │ │ └── Scripts │ │ │ └── camljs.js │ │ └── repositories.config └── spfx │ ├── .editorconfig │ ├── .gitignore │ ├── .vscode │ ├── extensions.json │ ├── launch.json │ └── settings.json │ ├── .yo-rc.json │ ├── config │ ├── config.json │ ├── copy-assets.json │ ├── deploy-azure-storage.json │ ├── package-solution.json │ ├── serve.json │ └── write-manifests.json │ ├── gulpfile.js │ ├── package-lock.json │ ├── package.json │ ├── src │ ├── index.ts │ └── webparts │ │ └── camlJsExample │ │ ├── CamlJsExampleWebPart.manifest.json │ │ ├── CamlJsExampleWebPart.ts │ │ └── components │ │ └── CamlJsExample.tsx │ ├── tsconfig.json │ └── tslint.json ├── lib └── camljs.ts ├── package-lock.json ├── package.json ├── postbuild.js ├── tests ├── aggregations.js ├── basics.js ├── contenttypeid.js ├── daterangesoverlap.js ├── expressions.js ├── finalize.js ├── joins.js ├── membership.js ├── modify.js └── vkbeautify.js └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | bin 2 | obj 3 | pkg 4 | pkgobj 5 | *.user 6 | *.suo 7 | *.js.map 8 | /VisualStudio/packages 9 | /VisualStudio/.vs 10 | node_modules 11 | /tests/Tests.js 12 | /tests/Tests.bundle.js 13 | /lib/camljs.js 14 | coverage 15 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "pwa-node", 9 | "request": "launch", 10 | "name": "Launch Program", 11 | "skipFiles": [ 12 | "/**" 13 | ], 14 | "sourceMaps": true, 15 | "program": "${file}", 16 | "outFiles": [ 17 | "${workspaceFolder}/**/*.js" 18 | ] 19 | } 20 | ] 21 | } -------------------------------------------------------------------------------- /CamlJs.nuspec: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | CamlJs 5 | 2.12.1 6 | Andrei Markeev 7 | Andrei Markeev 8 | https://github.com/andrei-markeev/camljs/blob/master/LICENSE 9 | http://github.com/andrei-markeev/camljs 10 | false 11 | Simplifies creation of SharePoint CAML queries for client-side scripts. Can be used with SharePoint Client Object Model and SPServices. 12 | SharePoint JavaScript CAML 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Microsoft Public License (Ms-PL) 2 | 3 | This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software. 4 | 5 | 1. Definitions 6 | 7 | The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law. 8 | 9 | A "contribution" is the original software, or any additions or changes to the software. 10 | 11 | A "contributor" is any person that distributes its contribution under this license. 12 | 13 | "Licensed patents" are a contributor's patent claims that read directly on its contribution. 14 | 15 | 2. Grant of Rights 16 | 17 | (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create. 18 | 19 | (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software. 20 | 21 | 3. Conditions and Limitations 22 | 23 | (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks. 24 | 25 | (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically. 26 | 27 | (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software. 28 | 29 | (D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license. 30 | 31 | (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Installation 2 | 3 | Nuget: 4 | ``` 5 | PM> Install-Package CamlJs 6 | ``` 7 | 8 | Npm: 9 | ``` 10 | npm install camljs 11 | ``` 12 | 13 | Also check out [CamlJs Console](https://github.com/andrei-markeev/camljs-console) - Chrome extension for testing queries with live preview against real lists. 14 | 15 | ## Usage 16 | 17 | In browser: 18 | ```html 19 | 20 | 23 | ``` 24 | 25 | In Node.js: 26 | ```js 27 | var CamlBuilder = require('camljs'); 28 | console.log(new CamlBuilder().View().ToString()); 29 | ``` 30 | 31 | ES2015 modules: 32 | ```js 33 | import * as CamlBuilder from 'camljs'; 34 | console.log(new CamlBuilder().View().ToString()); 35 | ``` 36 | 37 | ## Basics 38 | 39 | Let's assume we need to fetch all Google-related emails from a SharePoint list where your company stores archived project emails. To generate the corresponding query using CamlJs, you could use following javascript code: 40 | 41 | ```js 42 | var camlBuilder = new CamlBuilder(); 43 | 44 | var caml = camlBuilder.Where() 45 | .TextField("Email").EqualTo("support@google.com") 46 | .Or() 47 | .TextField("Email").EqualTo("plus@google.com") 48 | .Or() 49 | .TextField("Title").BeginsWith("[Google]") 50 | .Or() 51 | .TextField("Content").Contains("Google") 52 | .ToString(); 53 | ``` 54 | 55 | This will generate the following CAML code: 56 | 57 | ```xml 58 | 59 | 60 | 61 | 62 | support@google.com 63 | 64 | 65 | 66 | 67 | plus@google.com 68 | 69 | 70 | 71 | 72 | [Google] 73 | 74 | 75 | 76 | Google 77 | 78 | 79 | 80 | 81 | 82 | ``` 83 | 84 | It is also possible to generate SP.CamlQuery object, just change `.ToString()` to `.ToCamlQuery()`. 85 | 86 | Another example: 87 | ```js 88 | var caml = camlBuilder.Where() 89 | .LookupField("Category").Id().In([2, 3, 10]) 90 | .And() 91 | .DateField("ExpirationDate").LessThanOrEqualTo(CamlBuilder.CamlValues.Now) 92 | .OrderByDesc("ExpirationDate") 93 | .ToString() 94 | ``` 95 | As you see, the code is pretty clean and readable. The resulting CAML is much more awkward, especially if you imagine it in javascript strings dress, without indentation and highlighting... 96 | ```xml 97 | 98 | 99 | 100 | 101 | 102 | 2 103 | 3 104 | 10 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | ``` 118 | 119 | ## Dynamic queries 120 | 121 | It's very easy to create dynamic queries with CamlJs by leveraging the `CamlBuilder.Expression()` construction. 122 | It's like a standalone part of query that can be later used in the final `new CamlBuilder.Where()` or `new CamlBuilder.View()`. 123 | 124 | ```js 125 | var categories = ["Category 1", "Category 2", "Category 3"]; 126 | 127 | var categoriesExpressions = categories.map(c => CamlBuilder.Expression().TextField("Category").EqualTo(c)); 128 | 129 | var caml = new CamlBuilder().Where() 130 | .Any(categoriesExpressions), 131 | .ToString(); 132 | ``` 133 | Result: 134 | ```xml 135 | 136 | 137 | 138 | 139 | Category 1 140 | 141 | 142 | 143 | 144 | Category 2 145 | 146 | 147 | 148 | Category 3 149 | 150 | 151 | 152 | 153 | ``` 154 | 155 | While `.Any()` generates `` clauses, `.All()` will generate ``. 156 | 157 | ## Elements support 158 | 159 | CamlJs supports all Query elements that are [described on MSDN](http://msdn.microsoft.com/en-us/library/ms467521.aspx). 160 | 161 | For example, seldom used Membership element: 162 | ```js 163 | var caml = camlBuilder.Where() 164 | .UserField("AssignedTo").EqualToCurrentUser() 165 | .Or() 166 | .UserField("AssignedTo").IsInCurrentUserGroups() 167 | .GroupBy("ProductTitle") 168 | .OrderBy("Priority").ThenBy("Title") 169 | .ToString(); 170 | ``` 171 | This code will generate following CAML: 172 | 173 | ```xml 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | ``` 195 | 196 | ## Joins 197 | 198 | You can also create the upper-level View element as supported by SP.CamlQuery object. 199 | Scope attribute, ViewFields, Joins and ProjectedFields are supported in this case. 200 | 201 | Joining lists via CamlJs is very easy. Here's the example: 202 | 203 | ```js 204 | var query = new CamlBuilder() 205 | .View(["Title","Country","Population"]) 206 | .LeftJoin("Country","Country").Select("People","Population") 207 | .Query() 208 | .Where() 209 | .NumberField("Population").LessThan(10) 210 | .ToString(); 211 | ``` 212 | The resulting generated CAML query will be the following: 213 | ```xml 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 10 236 | 237 | 238 | 239 | 240 | ``` 241 | 242 | ## Modify existing queries 243 | 244 | Often you need to modify existing query (e.g. that comes from an existing list view), rather than generate a completely new one. 245 | This use case is also supported by CamlJs: 246 | 247 | - `CamlBuilder.FromXml(xml)` method will create a CamlBuilder object from existing CAML string 248 | - `ReplaceWhere` method then allows to replace clause with one generated by CamlJs 249 | - `ModifyWhere().AppendAnd()` will add new conditions to existing query using "And" operator 250 | - `ModifyWhere().AppendOr()` will add new conditions to existing query using "Or" operator 251 | 252 | Example: 253 | 254 | ```js 255 | var xml = new CamlBuilder().View().Query().Where() 256 | .UserField("Author").EqualToCurrentUser() 257 | .ToString(); 258 | 259 | var query = CamlBuilder.FromXml(xml) 260 | .ModifyWhere().AppendAnd() 261 | .LookupField("Country").ValueAsText().BeginsWith("G"); 262 | ``` 263 | 264 | Result: 265 | ```xml 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | G 279 | 280 | 281 | 282 | 283 | 284 | ``` 285 | 286 | ## More examples 287 | 288 | More query examples can be found under [tests](https://github.com/andrei-markeev/camljs/tree/master/tests) folder. 289 | 290 | Also, check out [examples](https://github.com/andrei-markeev/camljs/tree/master/examples) folder for usage examples in SP Addins and SPFx projects. 291 | -------------------------------------------------------------------------------- /dist/camljs.d.ts: -------------------------------------------------------------------------------- 1 | declare class CamlBuilder { 2 | constructor(); 3 | /** Generate CAML Query, starting from tag */ 4 | Where(): CamlBuilder.IFieldExpression; 5 | /** Generate CAML Query, starting from tag */ 6 | Query(): CamlBuilder.IQuery; 7 | /** Generate tag for SP.CamlQuery 8 | @param viewFields If omitted, default view fields are requested; otherwise, only values for the fields with the specified internal names are returned. 9 | Specifying view fields is a good practice, as it decreases traffic between server and client. 10 | Additionally you can specify aggregated fields, e.g. { count: "" }, { sum: "" }, etc.. */ 11 | View(viewFields?: CamlBuilder.ViewField[]): CamlBuilder.IView; 12 | /** Generate tag for SPServices */ 13 | ViewFields(viewFields: string[]): CamlBuilder.IFinalizableToString; 14 | /** Use for: 15 | 1. SPServices CAMLQuery attribute 16 | 2. Creating partial expressions 17 | 3. In conjunction with Any & All clauses 18 | */ 19 | static Expression(): CamlBuilder.IFieldExpression; 20 | static FromXml(xml: string): CamlBuilder.IRawQuery; 21 | } 22 | declare module CamlBuilder { 23 | type Aggregation = { 24 | count: string; 25 | } | { 26 | sum: string; 27 | } | { 28 | avg: string; 29 | } | { 30 | max: string; 31 | } | { 32 | min: string; 33 | } | { 34 | stdev: string; 35 | } | { 36 | var: string; 37 | }; 38 | type ViewField = string | Aggregation; 39 | interface IView extends IFinalizable { 40 | /** Define query */ 41 | Query(): IQuery; 42 | /** Define maximum amount of returned records */ 43 | RowLimit(limit: number, paged?: boolean): IView; 44 | /** Define view scope */ 45 | Scope(scope: ViewScope): IView; 46 | /** Join the list you're querying with another list. 47 | Joins are only allowed through a lookup field relation. 48 | @param lookupFieldInternalName Internal name of the lookup field, that points to the list you're going to join in. 49 | @alias alias for the joined list */ 50 | InnerJoin(lookupFieldInternalName: string, alias: string): IJoin; 51 | /** Join the list you're querying with another list. 52 | Joins are only allowed through a lookup field relation. 53 | @param lookupFieldInternalName Internal name of the lookup field, that points to the list you're going to join in. 54 | @alias alias for the joined list */ 55 | LeftJoin(lookupFieldInternalName: string, alias: string): IJoin; 56 | } 57 | interface IJoinable { 58 | /** Join the list you're querying with another list. 59 | Joins are only allowed through a lookup field relation. 60 | @param lookupFieldInternalName Internal name of the lookup field, that points to the list you're going to join in. 61 | @param alias Alias for the joined list 62 | @param fromList (optional) List where the lookup column resides - use it only for nested joins */ 63 | InnerJoin(lookupFieldInternalName: string, alias: string, fromList?: string): IJoin; 64 | /** Join the list you're querying with another list. 65 | Joins are only allowed through a lookup field relation. 66 | @param lookupFieldInternalName Internal name of the lookup field, that points to the list you're going to join in. 67 | @param alias Alias for the joined list 68 | @param fromList (optional) List where the lookup column resides - use it only for nested joins */ 69 | LeftJoin(lookupFieldInternalName: string, alias: string, fromList?: string): IJoin; 70 | } 71 | interface IJoin extends IJoinable { 72 | /** Select projected field for using in the main Query body 73 | @param remoteFieldAlias By this alias, the field can be used in the main Query body. */ 74 | Select(remoteFieldInternalName: string, remoteFieldAlias: string): IProjectableView; 75 | } 76 | interface IProjectableView extends IJoinable { 77 | /** Define query */ 78 | Query(): IQuery; 79 | /** Define maximum amount of returned records */ 80 | RowLimit(limit: number, paged?: boolean): IView; 81 | /** Define view scope */ 82 | Scope(scope: ViewScope): IView; 83 | /** Select projected field for using in the main Query body 84 | @param remoteFieldAlias By this alias, the field can be used in the main Query body. */ 85 | Select(remoteFieldInternalName: string, remoteFieldAlias: string): IProjectableView; 86 | } 87 | enum ViewScope { 88 | Recursive = 0, 89 | RecursiveAll = 1, 90 | FilesOnly = 2 91 | } 92 | interface IQuery extends IGroupable { 93 | Where(): IFieldExpression; 94 | } 95 | interface IFinalizableToString { 96 | /** Get the resulting CAML query as string */ 97 | ToString(): string; 98 | } 99 | interface IFinalizable extends IFinalizableToString { 100 | /** Get the resulting CAML query as SP.CamlQuery object */ 101 | ToCamlQuery(): any; 102 | } 103 | interface ISortable extends IFinalizable { 104 | /** Adds OrderBy clause to the query 105 | @param fieldInternalName Internal field of the first field by that the data will be sorted (ascending) 106 | @param override This is only necessary for large lists. DON'T use it unless you know what it is for! 107 | @param useIndexForOrderBy This is only necessary for large lists. DON'T use it unless you know what it is for! 108 | */ 109 | OrderBy(fieldInternalName: string, override?: boolean, useIndexForOrderBy?: boolean): ISortedQuery; 110 | /** Adds OrderBy clause to the query (using descending order for the first field). 111 | @param fieldInternalName Internal field of the first field by that the data will be sorted (descending) 112 | @param override This is only necessary for large lists. DON'T use it unless you know what it is for! 113 | @param useIndexForOrderBy This is only necessary for large lists. DON'T use it unless you know what it is for! 114 | */ 115 | OrderByDesc(fieldInternalName: string, override?: boolean, useIndexForOrderBy?: boolean): ISortedQuery; 116 | } 117 | interface IGroupable extends ISortable { 118 | /** Adds GroupBy clause to the query. 119 | @param collapse If true, only information about the groups is retrieved, otherwise items are also retrieved. 120 | @param groupLimit Return only first N groups */ 121 | GroupBy(fieldInternalName: any, collapse?: boolean, groupLimit?: number): IGroupedQuery; 122 | } 123 | interface IExpression extends IGroupable { 124 | /** Adds And clause to the query. */ 125 | And(): IFieldExpression; 126 | /** Adds Or clause to the query. */ 127 | Or(): IFieldExpression; 128 | } 129 | interface IGroupedQuery extends ISortable { 130 | } 131 | interface ISortedQuery extends IFinalizable { 132 | /** Specifies next order field (ascending) */ 133 | ThenBy(fieldInternalName: string): ISortedQuery; 134 | /** Specifies next order field (descending) */ 135 | ThenByDesc(fieldInternalName: string): ISortedQuery; 136 | } 137 | interface IFieldExpression { 138 | /** Adds And clauses to the query. Use for creating bracket-expressions in conjuction with CamlBuilder.Expression(). */ 139 | All(...conditions: IExpression[]): IExpression; 140 | /** Adds Or clauses to the query. Use for creating bracket-expressions in conjuction with CamlBuilder.Expression(). */ 141 | Any(...conditions: IExpression[]): IExpression; 142 | /** Adds And clauses to the query. Use for creating bracket-expressions in conjuction with CamlBuilder.Expression(). */ 143 | All(conditions: IExpression[]): IExpression; 144 | /** Adds Or clauses to the query. Use for creating bracket-expressions in conjuction with CamlBuilder.Expression(). */ 145 | Any(conditions: IExpression[]): IExpression; 146 | /** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is Text */ 147 | TextField(internalName: string): ITextFieldExpression; 148 | /** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is ContentTypeId */ 149 | ContentTypeIdField(internalName?: string): ITextFieldExpression; 150 | /** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is Choice */ 151 | ChoiceField(internalName: string): ITextFieldExpression; 152 | /** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is Computed */ 153 | ComputedField(internalName: string): ITextFieldExpression; 154 | /** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is Boolean */ 155 | BooleanField(internalName: string): IBooleanFieldExpression; 156 | /** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is URL */ 157 | UrlField(internalName: string): ITextFieldExpression; 158 | /** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is Number */ 159 | NumberField(internalName: string): INumberFieldExpression; 160 | /** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is Counter (usually ID fields) */ 161 | CounterField(internalName: string): INumberFieldExpression; 162 | /** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is Integer */ 163 | IntegerField(internalName: string): INumberFieldExpression; 164 | /** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is User */ 165 | UserField(internalName: string): IUserFieldExpression; 166 | /** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is Lookup */ 167 | LookupField(internalName: string): ILookupFieldExpression; 168 | /** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is LookupMulti */ 169 | LookupMultiField(internalName: string): ILookupMultiFieldExpression; 170 | /** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is UserMulti */ 171 | UserMultiField(internalName: string): IUserMultiFieldExpression; 172 | /** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is Date */ 173 | DateField(internalName: string): IDateTimeFieldExpression; 174 | /** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is DateTime */ 175 | DateTimeField(internalName: string): IDateTimeFieldExpression; 176 | /** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is ModStat (moderation status) */ 177 | ModStatField(internalName: string): IModStatFieldExpression; 178 | /** Used in queries for retrieving recurring calendar events. 179 | NOTICE: DateRangesOverlap with overlapType other than Now cannot be used with SP.CamlQuery, because it doesn't support 180 | CalendarDate and ExpandRecurrence query options. Lists.asmx, however, supports them, so you can still use DateRangesOverlap 181 | with SPServices. 182 | @param overlapType Defines type of overlap: return all events for a day, for a week, for a month or for a year 183 | @param calendarDate Defines date that will be used for determining events for which exactly day/week/month/year will be returned. 184 | This value is ignored for overlapType=Now, but for the other overlap types it is mandatory. 185 | @param eventDateField Internal name of "Start Time" field (default: "EventDate" - all OOTB Calendar lists use this name) 186 | @param endDateField Internal name of "End Time" field (default: "EndDate" - all OOTB Calendar lists use this name) 187 | @param recurrenceIDField Internal name of "Recurrence ID" field (default: "RecurrenceID" - all OOTB Calendar lists use this name) 188 | */ 189 | DateRangesOverlap(overlapType: DateRangesOverlapType, calendarDate: string, eventDateField?: string, endDateField?: string, recurrenceIDField?: string): IExpression; 190 | } 191 | interface IBooleanFieldExpression { 192 | /** Checks whether the value of the field is True */ 193 | IsTrue(): IExpression; 194 | /** Checks whether the value of the field is False */ 195 | IsFalse(): IExpression; 196 | /** Checks whether the value of the field is equal to the specified value */ 197 | EqualTo(value: boolean): IExpression; 198 | /** Checks whether the value of the field is not equal to the specified value */ 199 | NotEqualTo(value: boolean): IExpression; 200 | /** Checks whether the value of the field was specified by user */ 201 | IsNull(): IExpression; 202 | /** Checks whether the value of the field was not specified by user */ 203 | IsNotNull(): IExpression; 204 | } 205 | interface INumberFieldExpression { 206 | /** Checks whether the value of the field is equal to the specified value */ 207 | EqualTo(value: number): IExpression; 208 | /** Checks whether the value of the field is not equal to the specified value */ 209 | NotEqualTo(value: number): IExpression; 210 | /** Checks whether the value of the field is greater than the specified value */ 211 | GreaterThan(value: number): IExpression; 212 | /** Checks whether the value of the field is less than the specified value */ 213 | LessThan(value: number): IExpression; 214 | /** Checks whether the value of the field is greater than or equal to the specified value */ 215 | GreaterThanOrEqualTo(value: number): IExpression; 216 | /** Checks whether the value of the field is less than or equal to the specified value */ 217 | LessThanOrEqualTo(value: number): IExpression; 218 | /** Checks whether the value of the field was specified by user */ 219 | IsNull(): IExpression; 220 | /** Checks whether the value of the field was not specified by user */ 221 | IsNotNull(): IExpression; 222 | /** Checks whether the value of the field is equal to one of the specified values */ 223 | In(arrayOfValues: number[]): IExpression; 224 | } 225 | interface IDateTimeFieldExpression { 226 | /** Checks whether the value of the field was specified by user */ 227 | IsNull(): IExpression; 228 | /** Checks whether the value of the field was not specified by user */ 229 | IsNotNull(): IExpression; 230 | /** Checks whether the value of the field is equal to the specified value */ 231 | EqualTo(value: Date): IExpression; 232 | /** Checks whether the value of the field is not equal to the specified value */ 233 | NotEqualTo(value: Date): IExpression; 234 | /** Checks whether the value of the field is greater than the specified value */ 235 | GreaterThan(value: Date): IExpression; 236 | /** Checks whether the value of the field is less than the specified value */ 237 | LessThan(value: Date): IExpression; 238 | /** Checks whether the value of the field is greater than or equal to the specified value */ 239 | GreaterThanOrEqualTo(value: Date): IExpression; 240 | /** Checks whether the value of the field is less than or equal to the specified value */ 241 | LessThanOrEqualTo(value: Date): IExpression; 242 | /** Checks whether the value of the field is equal to one of the specified values */ 243 | In(arrayOfValues: Date[]): IExpression; 244 | /** Checks whether the value of the field is equal to the specified value. 245 | The datetime value should be defined in ISO 8601 format! */ 246 | EqualTo(value: string): IExpression; 247 | /** Checks whether the value of the field is not equal to the specified value. 248 | The datetime value should be defined in ISO 8601 format! */ 249 | NotEqualTo(value: string): IExpression; 250 | /** Checks whether the value of the field is greater than the specified value. 251 | The datetime value should be defined in ISO 8601 format! */ 252 | GreaterThan(value: string): IExpression; 253 | /** Checks whether the value of the field is less than the specified value. 254 | The datetime value should be defined in ISO 8601 format! */ 255 | LessThan(value: string): IExpression; 256 | /** Checks whether the value of the field is greater than or equal to the specified value. 257 | The datetime value should be defined in ISO 8601 format! */ 258 | GreaterThanOrEqualTo(value: string): IExpression; 259 | /** Checks whether the value of the field is less than or equal to the specified value. 260 | The datetime value should be defined in ISO 8601 format! */ 261 | LessThanOrEqualTo(value: string): IExpression; 262 | /** Checks whether the value of the field is equal to one of the specified values. 263 | The datetime value should be defined in ISO 8601 format! */ 264 | In(arrayOfValues: string[]): IExpression; 265 | } 266 | interface ITextFieldExpression { 267 | /** Checks whether the value of the field is equal to the specified value */ 268 | EqualTo(value: string): IExpression; 269 | /** Checks whether the value of the field is not equal to the specified value */ 270 | NotEqualTo(value: string): IExpression; 271 | /** Checks whether the value of the field contains the specified substring */ 272 | Contains(value: string): IExpression; 273 | /** Checks whether the value of the field begins with the specified substring */ 274 | BeginsWith(value: string): IExpression; 275 | /** Checks whether the value of the field was specified by user */ 276 | IsNull(): IExpression; 277 | /** Checks whether the value of the field was not specified by user */ 278 | IsNotNull(): IExpression; 279 | /** Checks whether the value of the field is equal to one of the specified values */ 280 | In(arrayOfValues: string[]): IExpression; 281 | } 282 | interface IUserFieldExpression { 283 | /** Checks whether the value of the User field is equal to id of the current user */ 284 | EqualToCurrentUser(): IExpression; 285 | /** Checks whether the group specified by the value of the field includes the current user. */ 286 | IsInCurrentUserGroups(): IExpression; 287 | /** Checks whether the user specified by the value of the field is member of the specified SharePoint Group. */ 288 | IsInSPGroup(groupId: number): IExpression; 289 | /** Checks whether the user specified by the value of the field is member of current SPWeb groups. */ 290 | IsInSPWebGroups(): IExpression; 291 | /** Checks whether the user specified by the value of the field is in current SPWeb users. */ 292 | IsInSPWebAllUsers(): IExpression; 293 | /** Checks whether the user specified by the value of the field has received the rights to the site directly (not through a group). */ 294 | IsInSPWebUsers(): IExpression; 295 | /** Specifies that id of the user will be used for further comparisons. */ 296 | Id(): INumberFieldExpression; 297 | /** Specifies that lookup target field value will be used for further comparisons. */ 298 | ValueAsText(): ITextFieldExpression; 299 | } 300 | interface ILookupFieldExpression { 301 | /** Specifies that lookup id value will be used. */ 302 | Id(): INumberFieldExpression; 303 | /** Specifies that lookup value will be used and this value is of type Text */ 304 | ValueAsText(): ITextFieldExpression; 305 | /** Specifies that lookup value will be used and this value is of type Number */ 306 | ValueAsNumber(): INumberFieldExpression; 307 | /** Specifies that lookup value will be used and this value is of type Date */ 308 | ValueAsDate(): IDateTimeFieldExpression; 309 | /** Specifies that lookup value will be used and this value is of type DateTime */ 310 | ValueAsDateTime(): IDateTimeFieldExpression; 311 | /** Specifies that lookup value will be used and this value is of type Boolean */ 312 | ValueAsBoolean(): IBooleanFieldExpression; 313 | } 314 | interface ILookupMultiFieldExpression { 315 | /** Checks a condition against every item in the multi lookup value */ 316 | IncludesSuchItemThat(): ILookupFieldExpression; 317 | /** Checks whether the field values collection is empty */ 318 | IsNull(): IExpression; 319 | /** Checks whether the field values collection is not empty */ 320 | IsNotNull(): IExpression; 321 | /** DEPRECATED: use "IncludesSuchItemThat().ValueAsText().EqualTo(value)" instead. */ 322 | Includes(value: any): IExpression; 323 | /** DEPRECATED: use "IncludesSuchItemThat().ValueAsText().NotEqualTo(value)" instead. */ 324 | NotIncludes(value: any): IExpression; 325 | /** DEPRECATED: "Eq" operation in CAML works exactly the same as "Includes". To avoid confusion, please use Includes. */ 326 | EqualTo(value: any): IExpression; 327 | /** DEPRECATED: "Neq" operation in CAML works exactly the same as "NotIncludes". To avoid confusion, please use NotIncludes. */ 328 | NotEqualTo(value: any): IExpression; 329 | } 330 | interface IUserMultiFieldExpression { 331 | /** Checks a condition against every item in the multi lookup value */ 332 | IncludesSuchItemThat(): IUserFieldExpression; 333 | /** Checks whether the field values collection is empty */ 334 | IsNull(): IExpression; 335 | /** Checks whether the field values collection is not empty */ 336 | IsNotNull(): IExpression; 337 | /** DEPRECATED: use "IncludesSuchItemThat().ValueAsText().EqualTo(value)" instead. */ 338 | Includes(value: any): IExpression; 339 | /** DEPRECATED: use "IncludesSuchItemThat().ValueAsText().NotEqualTo(value)" instead. */ 340 | NotIncludes(value: any): IExpression; 341 | /** DEPRECATED: "Eq" operation in CAML works exactly the same as "Includes". To avoid confusion, please use Includes. */ 342 | EqualTo(value: any): IExpression; 343 | /** DEPRECATED: "Neq" operation in CAML works exactly the same as "NotIncludes". To avoid confusion, please use NotIncludes. */ 344 | NotEqualTo(value: any): IExpression; 345 | } 346 | interface IModStatFieldExpression { 347 | /** Represents moderation status ID. */ 348 | ModStatId(): INumberFieldExpression; 349 | /** Checks whether the value of the field is Approved - same as ModStatId.EqualTo(0) */ 350 | IsApproved(): IExpression; 351 | /** Checks whether the value of the field is Rejected - same as ModStatId.EqualTo(1) */ 352 | IsRejected(): IExpression; 353 | /** Checks whether the value of the field is Pending - same as ModStatId.EqualTo(2) */ 354 | IsPending(): IExpression; 355 | /** Represents moderation status as localized text. In most cases it is better to use ModStatId in the queries instead of ValueAsText. */ 356 | ValueAsText(): ITextFieldExpression; 357 | } 358 | interface IRawQuery { 359 | /** Change Where clause */ 360 | ReplaceWhere(): IFieldExpression; 361 | ModifyWhere(): IRawQueryModify; 362 | } 363 | interface IRawQueryModify { 364 | AppendOr(): IFieldExpression; 365 | AppendAnd(): IFieldExpression; 366 | } 367 | enum DateRangesOverlapType { 368 | /** Returns events for today */ 369 | Now = 0, 370 | /** Returns events for one day, specified by CalendarDate in QueryOptions */ 371 | Day = 1, 372 | /** Returns events for one week, specified by CalendarDate in QueryOptions */ 373 | Week = 2, 374 | /** Returns events for one month, specified by CalendarDate in QueryOptions. 375 | Caution: usually also returns few days from previous and next months */ 376 | Month = 3, 377 | /** Returns events for one year, specified by CalendarDate in QueryOptions */ 378 | Year = 4 379 | } 380 | class Internal { 381 | static createView(viewFields?: ViewField[]): IView; 382 | static createViewFields(viewFields: string[]): IFinalizableToString; 383 | static createQuery(): IQuery; 384 | static createWhere(): IFieldExpression; 385 | static createExpression(): IFieldExpression; 386 | static createRawQuery(xml: string): IRawQuery; 387 | } 388 | class CamlValues { 389 | /** Dynamic value that represents Id of the current user */ 390 | static UserID: string; 391 | /** Dynamic value that represents current date */ 392 | static Today: string; 393 | /** Dynamic value that represents current date with specified offset (may be negative) */ 394 | static TodayWithOffset(offsetDays: number): string; 395 | static Now: string; 396 | /** Dynamic value that represents a property of the current list */ 397 | static ListProperty: { 398 | /** Date and time the list was created. */ 399 | Created: string; 400 | /** Server-relative URL of the default list view. */ 401 | DefaultViewUrl: string; 402 | /** Description of the list. */ 403 | Description: string; 404 | /** Determines if RSS syndication is enabled for the list */ 405 | EnableSyndication: string; 406 | /** Number of items in the list */ 407 | ItemCount: string; 408 | /** Title linked to the list */ 409 | LinkTitle: string; 410 | /** For a document library that uses version control with major versions only, maximum number of major versions allowed for items. */ 411 | MajorVersionLimit: string; 412 | /** For a document library that uses version control with both major and minor versions, maximum number of major versions allowed for items. */ 413 | MajorWithMinorVersionsLimit: string; 414 | /** Site-relative URL for the list. */ 415 | RelativeFolderPath: string; 416 | /** Title of the list. */ 417 | Title: string; 418 | /** View selector with links to views for the list. */ 419 | ViewSelector: string; 420 | }; 421 | /** Dynamic value that represents a property of the current SPWeb */ 422 | static ProjectProperty: { 423 | /** Category of the current post item. */ 424 | BlogCategoryTitle: string; 425 | /** Title of the current post item. */ 426 | BlogPostTitle: string; 427 | /** Represents a description for the current website. */ 428 | Description: string; 429 | /** Represents a value that determines whether the recycle bin is enabled for the current website. */ 430 | RecycleBinEnabled: string; 431 | /** User name of the owner for the current site collection. */ 432 | SiteOwnerName: string; 433 | /** Full URL of the current site collection. */ 434 | SiteUrl: string; 435 | /** Title of the current Web site. */ 436 | Title: string; 437 | /** Full URL of the current Web site. */ 438 | Url: string; 439 | }; 440 | } 441 | } 442 | export = CamlBuilder; 443 | -------------------------------------------------------------------------------- /examples/spAddIn/.vs/CamlJS/v15/Server/sqlite3/db.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrei-markeev/camljs/e7625b83ec4623e213ce96868170964e5ebd4067/examples/spAddIn/.vs/CamlJS/v15/Server/sqlite3/db.lock -------------------------------------------------------------------------------- /examples/spAddIn/.vs/CamlJS/v15/Server/sqlite3/storage.ide: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrei-markeev/camljs/e7625b83ec4623e213ce96868170964e5ebd4067/examples/spAddIn/.vs/CamlJS/v15/Server/sqlite3/storage.ide -------------------------------------------------------------------------------- /examples/spAddIn/CamlJS.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27428.2015 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CamlJs.SharePoint", "CamlJs.SharePoint\CamlJs.SharePoint.csproj", "{49F4736D-F3B5-4A58-98D9-CF9CA9181C11}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {49F4736D-F3B5-4A58-98D9-CF9CA9181C11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {49F4736D-F3B5-4A58-98D9-CF9CA9181C11}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {49F4736D-F3B5-4A58-98D9-CF9CA9181C11}.Debug|Any CPU.Deploy.0 = Debug|Any CPU 17 | {49F4736D-F3B5-4A58-98D9-CF9CA9181C11}.Release|Any CPU.ActiveCfg = Release|Any CPU 18 | {49F4736D-F3B5-4A58-98D9-CF9CA9181C11}.Release|Any CPU.Build.0 = Release|Any CPU 19 | {49F4736D-F3B5-4A58-98D9-CF9CA9181C11}.Release|Any CPU.Deploy.0 = Release|Any CPU 20 | EndGlobalSection 21 | GlobalSection(SolutionProperties) = preSolution 22 | HideSolutionNode = FALSE 23 | EndGlobalSection 24 | GlobalSection(ExtensibilityGlobals) = postSolution 25 | SolutionGuid = {4590ACD9-412F-42D6-AF30-DE5DA14ACC34} 26 | EndGlobalSection 27 | EndGlobal 28 | -------------------------------------------------------------------------------- /examples/spAddIn/CamlJs.SharePoint/AppManifest.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 9 | 10 | CamlJs.Sharepoint 11 | ~appWebUrl/Pages/Default.aspx?{StandardTokens} 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /examples/spAddIn/CamlJs.SharePoint/CamlJs.SharePoint.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {49F4736D-F3B5-4A58-98D9-CF9CA9181C11} 8 | Library 9 | Properties 10 | CamlJs.SharePoint 11 | CamlJs.SharePoint 12 | v4.5 13 | 16.1 14 | 512 15 | {C1CDDADD-2546-481F-9697-4EA41081F2FC};{14822709-B5A1-4724-98CA-57A101D1B079};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 16 | 12.0 17 | 12.2 18 | False 19 | SharePointApp 20 | {3a4e814e-bc6c-47b4-8af3-d59559b6f4ce} 21 | {52e6a47b-4d6b-4c7e-a529-ef391ba0cc49} 22 | {c7133800-25ed-4691-a5cc-3f006b28a9ec} 23 | {869f4b06-f1a9-4c12-bc05-019cbedf8e9c} 24 | {b545e350-3949-4cc9-a0ef-044b428a93fc} 25 | 26 | 27 | 28 | 29 | 12.0 30 | 31 | 32 | true 33 | full 34 | false 35 | bin\Debug\ 36 | DEBUG;TRACE 37 | prompt 38 | 4 39 | false 40 | 41 | 42 | pdbonly 43 | true 44 | bin\Release\ 45 | TRACE 46 | prompt 47 | 4 48 | false 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | {ad40c39b-3438-4ae9-9a32-1456bb16191b} 59 | 60 | 61 | {3e76f7ef-64de-4241-9666-ac57b4dbb8b9} 62 | 63 | 64 | 65 | {38f08423-1104-41c2-a471-204d575c5c29} 66 | 67 | 68 | 69 | 70 | {24602547-892a-4558-9367-23451fc974b3} 71 | 72 | 73 | 74 | 75 | {b545e350-3949-4cc9-a0ef-044b428a93fc} 76 | 77 | 78 | 79 | 80 | 81 | manifest-icon 82 | 83 | 84 | 85 | {73c76514-f268-4691-85bc-ee49ea993e8d} 86 | 87 | 88 | 89 | 90 | {93232521-ee01-4b22-8aad-6411b0cdf9c4} 91 | 92 | 93 | Package.package 94 | 95 | 96 | {572f521d-30ef-43d1-896a-9e7b62e1d3dd} 97 | 98 | 99 | MainFeature.feature 100 | 101 | 102 | 103 | 104 | Designer 105 | 106 | 107 | 108 | 109 | 10.0 110 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 111 | 112 | 113 | 114 | ES5 115 | false 116 | true 117 | AMD 118 | 119 | 120 | ES5 121 | true 122 | false 123 | AMD 124 | 125 | 126 | -------------------------------------------------------------------------------- /examples/spAddIn/CamlJs.SharePoint/Data/DataInstance/Elements.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | Afghanistan 8 | 9 | 10 | Albania 11 | 12 | 13 | Algeria 14 | 15 | 16 | Andorra 17 | 18 | 19 | Angola 20 | 21 | 22 | Antigua and Barbuda 23 | 24 | 25 | Argentina 26 | 27 | 28 | Armenia 29 | 30 | 31 | Aruba 32 | 33 | 34 | Australia 35 | 36 | 37 | Austria 38 | 39 | 40 | Azerbaijan 41 | 42 | 43 | Bahamas, The 44 | 45 | 46 | Bahrain 47 | 48 | 49 | Bangladesh 50 | 51 | 52 | Barbados 53 | 54 | 55 | Belarus 56 | 57 | 58 | Belgium 59 | 60 | 61 | Belize 62 | 63 | 64 | Benin 65 | 66 | 67 | Bhutan 68 | 69 | 70 | Bolivia 71 | 72 | 73 | Bosnia and Herzegovina 74 | 75 | 76 | Botswana 77 | 78 | 79 | Brazil 80 | 81 | 82 | Brunei 83 | 84 | 85 | Bulgaria 86 | 87 | 88 | Burkina Faso 89 | 90 | 91 | Burma 92 | 93 | 94 | Burundi 95 | 96 | 97 | Cambodia 98 | 99 | 100 | Cameroon 101 | 102 | 103 | Canada 104 | 105 | 106 | Cape Verde 107 | 108 | 109 | Central African Republic 110 | 111 | 112 | Chad 113 | 114 | 115 | Chile 116 | 117 | 118 | China 119 | 120 | 121 | Colombia 122 | 123 | 124 | Comoros 125 | 126 | 127 | Congo, Democratic Republic of the 128 | 129 | 130 | Congo, Republic of the 131 | 132 | 133 | Costa Rica 134 | 135 | 136 | Cote d'Ivoire 137 | 138 | 139 | Croatia 140 | 141 | 142 | Cuba 143 | 144 | 145 | Curacao 146 | 147 | 148 | Cyprus 149 | 150 | 151 | Czech Republic 152 | 153 | 154 | Denmark 155 | 156 | 157 | Djibouti 158 | 159 | 160 | Dominica 161 | 162 | 163 | Dominican Republic 164 | 165 | 166 | Ecuador 167 | 168 | 169 | Egypt 170 | 171 | 172 | El Salvador 173 | 174 | 175 | Equatorial Guinea 176 | 177 | 178 | Eritrea 179 | 180 | 181 | Estonia 182 | 183 | 184 | Ethiopia 185 | 186 | 187 | Fiji 188 | 189 | 190 | Finland 191 | 192 | 193 | France 194 | 195 | 196 | 197 | 198 | -------------------------------------------------------------------------------- /examples/spAddIn/CamlJs.SharePoint/Data/DataInstance/SharePointProjectItem.spdata: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /examples/spAddIn/CamlJs.SharePoint/Data/Elements.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 14 | 15 | -------------------------------------------------------------------------------- /examples/spAddIn/CamlJs.SharePoint/Data/Schema.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | main.xsl 19 | 30 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | main.xsl 36 | clienttemplates.js 37 | 30 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 |
53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /examples/spAddIn/CamlJs.SharePoint/Data/SharePointProjectItem.spdata: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /examples/spAddIn/CamlJs.SharePoint/Elements.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /examples/spAddIn/CamlJs.SharePoint/Features/MainFeature/MainFeature.Template.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /examples/spAddIn/CamlJs.SharePoint/Features/MainFeature/MainFeature.feature: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/spAddIn/CamlJs.SharePoint/Images/AppIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrei-markeev/camljs/e7625b83ec4623e213ce96868170964e5ebd4067/examples/spAddIn/CamlJs.SharePoint/Images/AppIcon.png -------------------------------------------------------------------------------- /examples/spAddIn/CamlJs.SharePoint/Images/Elements.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /examples/spAddIn/CamlJs.SharePoint/Images/SharePointProjectItem.spdata: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/spAddIn/CamlJs.SharePoint/Package/Package.Template.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /examples/spAddIn/CamlJs.SharePoint/Package/Package.package: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/spAddIn/CamlJs.SharePoint/Pages/Default.aspx: -------------------------------------------------------------------------------- 1 | <%-- The following 4 lines are ASP.NET directives needed when using SharePoint components --%> 2 | 3 | <%@ Page Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" MasterPageFile="~masterurl/default.master" Language="C#" %> 4 | 5 | <%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 6 | <%@ Register TagPrefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 7 | <%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 8 | 9 | <%-- The markup and script in the following Content element will be placed in the of the page --%> 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 51 | 71 | 72 | 73 | 74 | <%-- The markup in the following Content element will be placed in the TitleArea of the page --%> 75 | 76 | CamlJs Test App 77 | 78 | 79 | <%-- The markup and script in the following Content element will be placed in the of the page --%> 80 | 81 | 82 |

Select a query:

83 | 94 | 95 |

CamlJs code:

96 |
97 |
Please select a query first...
98 |
99 | 100 |

The generated CAML query XML:

101 |
102 |
Please select a query first...
103 |
104 | 105 |

Output from this list:

106 |
107 |
Please select a query first...
108 |
109 | 110 |

Full code:

111 |
112 |
Please select a query first...
113 |
114 | 115 |
116 | -------------------------------------------------------------------------------- /examples/spAddIn/CamlJs.SharePoint/Pages/Elements.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /examples/spAddIn/CamlJs.SharePoint/Pages/SharePointProjectItem.spdata: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/spAddIn/CamlJs.SharePoint/Scripts/Elements.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /examples/spAddIn/CamlJs.SharePoint/Scripts/SharePointProjectItem.spdata: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/spAddIn/CamlJs.SharePoint/Scripts/vkbeautify.js: -------------------------------------------------------------------------------- 1 | /** 2 | * vkBeautify - javascript plugin to pretty-print or minify text in XML, JSON, CSS and SQL formats. 3 | * 4 | * Version - 0.99.00.beta 5 | * Copyright (c) 2012 Vadim Kiryukhin 6 | * vkiryukhin @ gmail.com 7 | * http://www.eslinstructor.net/vkbeautify/ 8 | * 9 | * Dual licensed under the MIT and GPL licenses: 10 | * http://www.opensource.org/licenses/mit-license.php 11 | * http://www.gnu.org/licenses/gpl.html 12 | * 13 | */ 14 | 15 | (function () { 16 | 17 | function createShiftArr(step) { 18 | 19 | var space = ' '; 20 | 21 | if (isNaN(parseInt(step))) { // argument is string 22 | space = step; 23 | } else { // argument is integer 24 | switch (step) { 25 | case 1: space = ' '; break; 26 | case 2: space = ' '; break; 27 | case 3: space = ' '; break; 28 | case 4: space = ' '; break; 29 | case 5: space = ' '; break; 30 | case 6: space = ' '; break; 31 | case 7: space = ' '; break; 32 | case 8: space = ' '; break; 33 | case 9: space = ' '; break; 34 | case 10: space = ' '; break; 35 | case 11: space = ' '; break; 36 | case 12: space = ' '; break; 37 | } 38 | } 39 | 40 | var shift = ['\n']; // array of shifts 41 | for (ix = 0; ix < 100; ix++) { 42 | shift.push(shift[ix] + space); 43 | } 44 | return shift; 45 | } 46 | 47 | function vkbeautify() { 48 | this.step = ' '; // 4 spaces 49 | this.shift = createShiftArr(this.step); 50 | }; 51 | 52 | vkbeautify.prototype.xml = function (text, step) { 53 | 54 | var ar = text.replace(/>\s{0,}<") 55 | .replace(/ 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /examples/spAddIn/CamlJs.SharePoint/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /examples/spAddIn/packages/CamlJs.2.8.2/CamlJs.2.8.2.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrei-markeev/camljs/e7625b83ec4623e213ce96868170964e5ebd4067/examples/spAddIn/packages/CamlJs.2.8.2/CamlJs.2.8.2.nupkg -------------------------------------------------------------------------------- /examples/spAddIn/packages/repositories.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /examples/spfx/.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | 8 | [*] 9 | 10 | # change these settings to your own preference 11 | indent_style = space 12 | indent_size = 2 13 | 14 | # we recommend you to keep these unchanged 15 | end_of_line = lf 16 | charset = utf-8 17 | trim_trailing_whitespace = true 18 | insert_final_newline = true 19 | 20 | [*.md] 21 | trim_trailing_whitespace = false 22 | 23 | [{package,bower}.json] 24 | indent_style = space 25 | indent_size = 2 -------------------------------------------------------------------------------- /examples/spfx/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | 6 | # Dependency directories 7 | node_modules 8 | 9 | # Build generated files 10 | dist 11 | lib 12 | solution 13 | release 14 | temp 15 | *.sppkg 16 | 17 | # Coverage directory used by tools like istanbul 18 | coverage 19 | 20 | # OSX 21 | .DS_Store 22 | 23 | # Visual Studio files 24 | .ntvs_analysis.dat 25 | .vs 26 | bin 27 | obj 28 | 29 | # Resx Generated Code 30 | *.resx.ts 31 | 32 | # Styles Generated Code 33 | *.scss.ts 34 | -------------------------------------------------------------------------------- /examples/spfx/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "msjsdiag.debugger-for-chrome" 4 | ] 5 | } -------------------------------------------------------------------------------- /examples/spfx/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | /** 3 | * Install Chrome Debugger Extension for Visual Studio Code to debug your components with the 4 | * Chrome browser: https://aka.ms/spfx-debugger-extensions 5 | */ 6 | "version": "0.2.0", 7 | "configurations": [ 8 | { 9 | "name": "Hosted workbench", 10 | "type": "chrome", 11 | "request": "launch", 12 | "url": "https://enter-your-SharePoint-site/_layouts/workbench.aspx", 13 | "webRoot": "${workspaceRoot}", 14 | "sourceMaps": true, 15 | "sourceMapPathOverrides": { 16 | "webpack:///.././src/*": "${webRoot}/src/*", 17 | "webpack:///../../../src/*": "${webRoot}/src/*", 18 | "webpack:///../../../../src/*": "${webRoot}/src/*", 19 | "webpack:///../../../../../src/*": "${webRoot}/src/*" 20 | }, 21 | "runtimeArgs": [ 22 | "--remote-debugging-port=9222", 23 | "-incognito" 24 | ] 25 | } 26 | ] 27 | } -------------------------------------------------------------------------------- /examples/spfx/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // Place your settings in this file to overwrite default and user settings. 2 | { 3 | // Configure glob patterns for excluding files and folders in the file explorer. 4 | "files.exclude": { 5 | "**/.git": true, 6 | "**/.DS_Store": true, 7 | "**/bower_components": true, 8 | "**/coverage": true, 9 | "**/lib-amd": true, 10 | "src/**/*.scss.ts": true 11 | }, 12 | "typescript.tsdk": ".\\node_modules\\typescript\\lib" 13 | } -------------------------------------------------------------------------------- /examples/spfx/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "@microsoft/generator-sharepoint": { 3 | "plusBeta": false, 4 | "isCreatingSolution": true, 5 | "environment": "spo", 6 | "version": "1.13.0", 7 | "libraryName": "caml-js-example-webpart", 8 | "libraryId": "02e219b9-67b7-484b-8df2-0dda74721670", 9 | "packageManager": "npm", 10 | "isDomainIsolated": false, 11 | "componentType": "webpart" 12 | } 13 | } -------------------------------------------------------------------------------- /examples/spfx/config/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json", 3 | "version": "2.0", 4 | "bundles": { 5 | "caml-js-example-web-part": { 6 | "components": [ 7 | { 8 | "entrypoint": "./lib/webparts/camlJsExample/CamlJsExampleWebPart.js", 9 | "manifest": "./src/webparts/camlJsExample/CamlJsExampleWebPart.manifest.json" 10 | } 11 | ] 12 | } 13 | }, 14 | "externals": {}, 15 | "localizedResources": { 16 | "CamlJsExampleWebPartStrings": "lib/webparts/camlJsExample/loc/{locale}.js" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /examples/spfx/config/copy-assets.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/copy-assets.schema.json", 3 | "deployCdnPath": "temp/deploy" 4 | } 5 | -------------------------------------------------------------------------------- /examples/spfx/config/deploy-azure-storage.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json", 3 | "workingDir": "./temp/deploy/", 4 | "account": "", 5 | "container": "spfx", 6 | "accessKey": "" 7 | } -------------------------------------------------------------------------------- /examples/spfx/config/package-solution.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json", 3 | "solution": { 4 | "name": "camljs-spfx-client-side-solution", 5 | "id": "b73a2d02-68f2-45fe-806c-362d555ccc17", 6 | "version": "1.0.0.0", 7 | "includeClientSideAssets": true 8 | }, 9 | "paths": { 10 | "zippedPackage": "solution/camljs-spfx.sppkg" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/spfx/config/serve.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://developer.microsoft.com/json-schemas/core-build/serve.schema.json", 3 | "port": 4321, 4 | "https": true, 5 | "initialPage": "https://markeev.sharepoint.com/_layouts/workbench.aspx" 6 | } -------------------------------------------------------------------------------- /examples/spfx/config/write-manifests.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/write-manifests.schema.json", 3 | "cdnBasePath": "" 4 | } -------------------------------------------------------------------------------- /examples/spfx/gulpfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const build = require('@microsoft/sp-build-web'); 4 | 5 | build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`); 6 | 7 | var getTasks = build.rig.getTasks; 8 | build.rig.getTasks = function () { 9 | var result = getTasks.call(build.rig); 10 | 11 | result.set('serve', result.get('serve-deprecated')); 12 | 13 | return result; 14 | }; 15 | 16 | build.initialize(require('gulp')); 17 | -------------------------------------------------------------------------------- /examples/spfx/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "caml-js-example-webpart", 3 | "version": "0.0.1", 4 | "private": true, 5 | "main": "lib/index.js", 6 | "scripts": { 7 | "build": "gulp bundle", 8 | "clean": "gulp clean", 9 | "test": "gulp test" 10 | }, 11 | "dependencies": { 12 | "@microsoft/sp-core-library": "1.13.0", 13 | "@microsoft/sp-lodash-subset": "1.13.0", 14 | "@microsoft/sp-office-ui-fabric-core": "1.13.0", 15 | "@microsoft/sp-property-pane": "1.13.0", 16 | "@microsoft/sp-webpart-base": "1.13.0", 17 | "camljs": "^2.12.1", 18 | "office-ui-fabric-react": "7.174.1", 19 | "react": "16.13.1", 20 | "react-dom": "16.13.1" 21 | }, 22 | "devDependencies": { 23 | "@microsoft/rush-stack-compiler-3.9": "0.4.47", 24 | "@microsoft/sp-build-web": "1.13.0", 25 | "@microsoft/sp-module-interfaces": "1.13.0", 26 | "@microsoft/sp-tslint-rules": "1.13.0", 27 | "@types/react": "16.9.51", 28 | "@types/react-dom": "16.9.8", 29 | "@types/webpack-env": "1.13.1", 30 | "ajv": "~5.2.2", 31 | "gulp": "~4.0.2" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /examples/spfx/src/index.ts: -------------------------------------------------------------------------------- 1 | // A file is required to be in the root of the /src directory by the TypeScript compiler 2 | -------------------------------------------------------------------------------- /examples/spfx/src/webparts/camlJsExample/CamlJsExampleWebPart.manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-web-part-manifest.schema.json", 3 | "id": "820c8b32-a3b1-4121-a941-1ec5dd575781", 4 | "alias": "CamlJsExampleWebPart", 5 | "componentType": "WebPart", 6 | 7 | // The "*" signifies that the version should be taken from the package.json 8 | "version": "*", 9 | "manifestVersion": 2, 10 | 11 | // If true, the component can only be installed on sites where Custom Script is allowed. 12 | // Components that allow authors to embed arbitrary script code should set this to true. 13 | // https://support.office.com/en-us/article/Turn-scripting-capabilities-on-or-off-1f2c515f-5d7e-448a-9fd7-835da935584f 14 | "requiresCustomScript": false, 15 | 16 | "preconfiguredEntries": [{ 17 | "groupId": "5c03119e-3074-46fd-976b-c60198311f70", // Other 18 | "group": { "default": "Other" }, 19 | "title": { "default": "CamlJsExample" }, 20 | "description": { "default": "Example of using CamlJs in SPFx" }, 21 | "officeFabricIconFontName": "Page", 22 | "properties": { 23 | "description": "CamlJsExample" 24 | } 25 | }] 26 | } 27 | -------------------------------------------------------------------------------- /examples/spfx/src/webparts/camlJsExample/CamlJsExampleWebPart.ts: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import * as ReactDom from 'react-dom'; 3 | import { Version } from '@microsoft/sp-core-library'; 4 | import { BaseClientSideWebPart } from '@microsoft/sp-webpart-base'; 5 | 6 | import CamlJsExample from './components/CamlJsExample'; 7 | 8 | export interface ICamlJsExampleWebPartProps { 9 | description: string; 10 | } 11 | 12 | export default class CamlJsExampleWebPart extends BaseClientSideWebPart { 13 | 14 | public render(): void { 15 | const element = React.createElement(CamlJsExample, { context: this.context }); 16 | ReactDom.render(element, this.domElement); 17 | } 18 | 19 | protected onDispose(): void { 20 | ReactDom.unmountComponentAtNode(this.domElement); 21 | } 22 | 23 | protected get dataVersion(): Version { 24 | return Version.parse('1.0'); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /examples/spfx/src/webparts/camlJsExample/components/CamlJsExample.tsx: -------------------------------------------------------------------------------- 1 | import { WebPartContext } from "@microsoft/sp-webpart-base"; 2 | import * as React from "react"; 3 | import * as CamlBuilder from "camljs"; 4 | import { SPHttpClient, SPHttpClientResponse } from "@microsoft/sp-http"; 5 | 6 | export interface IAppProps { 7 | context: WebPartContext; 8 | } 9 | export interface IAppState { 10 | items: IListItem[]; 11 | } 12 | export interface IListItem { 13 | Title: string; 14 | } 15 | 16 | export default class CamlJsExample extends React.Component { 17 | public componentWillMount(): void { 18 | this.setState({ items: [] }); 19 | } 20 | public componentDidMount(): void { 21 | this.props.context.spHttpClient.post( 22 | `${this.props.context.pageContext.web.absoluteUrl}/_api/web/lists/getbytitle('Cities')/getitems`, 23 | SPHttpClient.configurations.v1, 24 | { 25 | body: JSON.stringify({ 26 | query: { 27 | ViewXml: new CamlBuilder().View().Query().Where().BooleanField('Visited').IsTrue().ToString() 28 | } 29 | }) 30 | } 31 | ) 32 | .then((response: SPHttpClientResponse) => { 33 | return response.json(); 34 | }) 35 | .then(items => { 36 | this.setState({ items: items.value }); 37 | }); 38 | } 39 | public render(): JSX.Element { 40 | return (
    {this.state.items.map(i =>
  • {i.Title}
  • )}
); 41 | } 42 | } -------------------------------------------------------------------------------- /examples/spfx/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./node_modules/@microsoft/rush-stack-compiler-3.9/includes/tsconfig-web.json", 3 | "compilerOptions": { 4 | "target": "es5", 5 | "forceConsistentCasingInFileNames": true, 6 | "module": "esnext", 7 | "moduleResolution": "node", 8 | "jsx": "react", 9 | "declaration": true, 10 | "sourceMap": true, 11 | "experimentalDecorators": true, 12 | "skipLibCheck": true, 13 | "outDir": "lib", 14 | "inlineSources": false, 15 | "strictNullChecks": false, 16 | "noUnusedLocals": false, 17 | "typeRoots": [ 18 | "./node_modules/@types", 19 | "./node_modules/@microsoft" 20 | ], 21 | "types": [ 22 | "webpack-env" 23 | ], 24 | "lib": [ 25 | "es5", 26 | "dom", 27 | "es2015.collection", 28 | "es2015.promise" 29 | ] 30 | }, 31 | "include": [ 32 | "src/**/*.ts", 33 | "src/**/*.tsx" 34 | ] 35 | } -------------------------------------------------------------------------------- /examples/spfx/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./node_modules/@microsoft/sp-tslint-rules/base-tslint.json", 3 | "rules": { 4 | "class-name": false, 5 | "export-name": false, 6 | "forin": false, 7 | "label-position": false, 8 | "member-access": true, 9 | "no-arg": false, 10 | "no-console": false, 11 | "no-construct": false, 12 | "no-duplicate-variable": true, 13 | "no-eval": false, 14 | "no-function-expression": true, 15 | "no-internal-module": true, 16 | "no-shadowed-variable": true, 17 | "no-switch-case-fall-through": true, 18 | "no-unnecessary-semicolons": true, 19 | "no-unused-expression": true, 20 | "no-with-statement": true, 21 | "semicolon": true, 22 | "trailing-comma": false, 23 | "typedef": false, 24 | "typedef-whitespace": false, 25 | "use-named-parameter": true, 26 | "variable-name": false, 27 | "whitespace": false 28 | } 29 | } -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "camljs", 3 | "version": "2.12.1", 4 | "lockfileVersion": 2, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "version": "2.12.1", 9 | "license": "MS-PL", 10 | "dependencies": { 11 | "@xmldom/xmldom": "^0.7.5" 12 | }, 13 | "devDependencies": { 14 | "@types/node": "^9.6.61", 15 | "c8": "^7.10.0", 16 | "typescript": "^4.4.4", 17 | "uvu": "^0.5.2" 18 | } 19 | }, 20 | "node_modules/@bcoe/v8-coverage": { 21 | "version": "0.2.3", 22 | "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", 23 | "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", 24 | "dev": true 25 | }, 26 | "node_modules/@istanbuljs/schema": { 27 | "version": "0.1.3", 28 | "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", 29 | "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", 30 | "dev": true, 31 | "engines": { 32 | "node": ">=8" 33 | } 34 | }, 35 | "node_modules/@types/istanbul-lib-coverage": { 36 | "version": "2.0.3", 37 | "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", 38 | "integrity": "sha512-sz7iLqvVUg1gIedBOvlkxPlc8/uVzyS5OwGz1cKjXzkl3FpL3al0crU8YGU1WoHkxn0Wxbw5tyi6hvzJKNzFsw==", 39 | "dev": true 40 | }, 41 | "node_modules/@types/node": { 42 | "version": "9.6.61", 43 | "resolved": "https://registry.npmjs.org/@types/node/-/node-9.6.61.tgz", 44 | "integrity": "sha512-/aKAdg5c8n468cYLy2eQrcR5k6chlbNwZNGUj3TboyPa2hcO2QAJcfymlqPzMiRj8B6nYKXjzQz36minFE0RwQ==", 45 | "dev": true 46 | }, 47 | "node_modules/@xmldom/xmldom": { 48 | "version": "0.7.5", 49 | "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.7.5.tgz", 50 | "integrity": "sha512-V3BIhmY36fXZ1OtVcI9W+FxQqxVLsPKcNjWigIaa81dLC9IolJl5Mt4Cvhmr0flUnjSpTdrbMTSbXqYqV5dT6A==", 51 | "engines": { 52 | "node": ">=10.0.0" 53 | } 54 | }, 55 | "node_modules/ansi-regex": { 56 | "version": "5.0.1", 57 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", 58 | "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", 59 | "dev": true, 60 | "engines": { 61 | "node": ">=8" 62 | } 63 | }, 64 | "node_modules/ansi-styles": { 65 | "version": "4.3.0", 66 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", 67 | "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", 68 | "dev": true, 69 | "dependencies": { 70 | "color-convert": "^2.0.1" 71 | }, 72 | "engines": { 73 | "node": ">=8" 74 | }, 75 | "funding": { 76 | "url": "https://github.com/chalk/ansi-styles?sponsor=1" 77 | } 78 | }, 79 | "node_modules/balanced-match": { 80 | "version": "1.0.0", 81 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", 82 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", 83 | "dev": true 84 | }, 85 | "node_modules/brace-expansion": { 86 | "version": "1.1.11", 87 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 88 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 89 | "dev": true, 90 | "dependencies": { 91 | "balanced-match": "^1.0.0", 92 | "concat-map": "0.0.1" 93 | } 94 | }, 95 | "node_modules/c8": { 96 | "version": "7.10.0", 97 | "resolved": "https://registry.npmjs.org/c8/-/c8-7.10.0.tgz", 98 | "integrity": "sha512-OAwfC5+emvA6R7pkYFVBTOtI5ruf9DahffGmIqUc9l6wEh0h7iAFP6dt/V9Ioqlr2zW5avX9U9/w1I4alTRHkA==", 99 | "dev": true, 100 | "dependencies": { 101 | "@bcoe/v8-coverage": "^0.2.3", 102 | "@istanbuljs/schema": "^0.1.2", 103 | "find-up": "^5.0.0", 104 | "foreground-child": "^2.0.0", 105 | "istanbul-lib-coverage": "^3.0.1", 106 | "istanbul-lib-report": "^3.0.0", 107 | "istanbul-reports": "^3.0.2", 108 | "rimraf": "^3.0.0", 109 | "test-exclude": "^6.0.0", 110 | "v8-to-istanbul": "^8.0.0", 111 | "yargs": "^16.2.0", 112 | "yargs-parser": "^20.2.7" 113 | }, 114 | "bin": { 115 | "c8": "bin/c8.js" 116 | }, 117 | "engines": { 118 | "node": ">=10.12.0" 119 | } 120 | }, 121 | "node_modules/cliui": { 122 | "version": "7.0.4", 123 | "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", 124 | "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", 125 | "dev": true, 126 | "dependencies": { 127 | "string-width": "^4.2.0", 128 | "strip-ansi": "^6.0.0", 129 | "wrap-ansi": "^7.0.0" 130 | } 131 | }, 132 | "node_modules/color-convert": { 133 | "version": "2.0.1", 134 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", 135 | "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", 136 | "dev": true, 137 | "dependencies": { 138 | "color-name": "~1.1.4" 139 | }, 140 | "engines": { 141 | "node": ">=7.0.0" 142 | } 143 | }, 144 | "node_modules/color-name": { 145 | "version": "1.1.4", 146 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", 147 | "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", 148 | "dev": true 149 | }, 150 | "node_modules/concat-map": { 151 | "version": "0.0.1", 152 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 153 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", 154 | "dev": true 155 | }, 156 | "node_modules/cross-spawn": { 157 | "version": "7.0.3", 158 | "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", 159 | "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", 160 | "dev": true, 161 | "dependencies": { 162 | "path-key": "^3.1.0", 163 | "shebang-command": "^2.0.0", 164 | "which": "^2.0.1" 165 | }, 166 | "engines": { 167 | "node": ">= 8" 168 | } 169 | }, 170 | "node_modules/dequal": { 171 | "version": "2.0.2", 172 | "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.2.tgz", 173 | "integrity": "sha512-q9K8BlJVxK7hQYqa6XISGmBZbtQQWVXSrRrWreHC94rMt1QL/Impruc+7p2CYSYuVIUr+YCt6hjrs1kkdJRTug==", 174 | "dev": true, 175 | "engines": { 176 | "node": ">=6" 177 | } 178 | }, 179 | "node_modules/emoji-regex": { 180 | "version": "8.0.0", 181 | "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", 182 | "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", 183 | "dev": true 184 | }, 185 | "node_modules/escalade": { 186 | "version": "3.1.1", 187 | "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", 188 | "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", 189 | "dev": true, 190 | "engines": { 191 | "node": ">=6" 192 | } 193 | }, 194 | "node_modules/find-up": { 195 | "version": "5.0.0", 196 | "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", 197 | "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", 198 | "dev": true, 199 | "dependencies": { 200 | "locate-path": "^6.0.0", 201 | "path-exists": "^4.0.0" 202 | }, 203 | "engines": { 204 | "node": ">=10" 205 | }, 206 | "funding": { 207 | "url": "https://github.com/sponsors/sindresorhus" 208 | } 209 | }, 210 | "node_modules/foreground-child": { 211 | "version": "2.0.0", 212 | "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", 213 | "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", 214 | "dev": true, 215 | "dependencies": { 216 | "cross-spawn": "^7.0.0", 217 | "signal-exit": "^3.0.2" 218 | }, 219 | "engines": { 220 | "node": ">=8.0.0" 221 | } 222 | }, 223 | "node_modules/fs.realpath": { 224 | "version": "1.0.0", 225 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 226 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", 227 | "dev": true 228 | }, 229 | "node_modules/get-caller-file": { 230 | "version": "2.0.5", 231 | "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", 232 | "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", 233 | "dev": true, 234 | "engines": { 235 | "node": "6.* || 8.* || >= 10.*" 236 | } 237 | }, 238 | "node_modules/glob": { 239 | "version": "7.2.0", 240 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", 241 | "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", 242 | "dev": true, 243 | "dependencies": { 244 | "fs.realpath": "^1.0.0", 245 | "inflight": "^1.0.4", 246 | "inherits": "2", 247 | "minimatch": "^3.0.4", 248 | "once": "^1.3.0", 249 | "path-is-absolute": "^1.0.0" 250 | }, 251 | "engines": { 252 | "node": "*" 253 | }, 254 | "funding": { 255 | "url": "https://github.com/sponsors/isaacs" 256 | } 257 | }, 258 | "node_modules/html-escaper": { 259 | "version": "2.0.2", 260 | "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", 261 | "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", 262 | "dev": true 263 | }, 264 | "node_modules/inflight": { 265 | "version": "1.0.6", 266 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 267 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 268 | "dev": true, 269 | "dependencies": { 270 | "once": "^1.3.0", 271 | "wrappy": "1" 272 | } 273 | }, 274 | "node_modules/inherits": { 275 | "version": "2.0.3", 276 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 277 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", 278 | "dev": true 279 | }, 280 | "node_modules/is-fullwidth-code-point": { 281 | "version": "3.0.0", 282 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", 283 | "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", 284 | "dev": true, 285 | "engines": { 286 | "node": ">=8" 287 | } 288 | }, 289 | "node_modules/isexe": { 290 | "version": "2.0.0", 291 | "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", 292 | "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", 293 | "dev": true 294 | }, 295 | "node_modules/istanbul-lib-coverage": { 296 | "version": "3.2.0", 297 | "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", 298 | "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", 299 | "dev": true, 300 | "engines": { 301 | "node": ">=8" 302 | } 303 | }, 304 | "node_modules/istanbul-lib-report": { 305 | "version": "3.0.0", 306 | "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", 307 | "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", 308 | "dev": true, 309 | "dependencies": { 310 | "istanbul-lib-coverage": "^3.0.0", 311 | "make-dir": "^3.0.0", 312 | "supports-color": "^7.1.0" 313 | }, 314 | "engines": { 315 | "node": ">=8" 316 | } 317 | }, 318 | "node_modules/istanbul-lib-report/node_modules/has-flag": { 319 | "version": "4.0.0", 320 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", 321 | "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", 322 | "dev": true, 323 | "engines": { 324 | "node": ">=8" 325 | } 326 | }, 327 | "node_modules/istanbul-lib-report/node_modules/supports-color": { 328 | "version": "7.2.0", 329 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", 330 | "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", 331 | "dev": true, 332 | "dependencies": { 333 | "has-flag": "^4.0.0" 334 | }, 335 | "engines": { 336 | "node": ">=8" 337 | } 338 | }, 339 | "node_modules/istanbul-reports": { 340 | "version": "3.0.5", 341 | "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.5.tgz", 342 | "integrity": "sha512-5+19PlhnGabNWB7kOFnuxT8H3T/iIyQzIbQMxXsURmmvKg86P2sbkrGOT77VnHw0Qr0gc2XzRaRfMZYYbSQCJQ==", 343 | "dev": true, 344 | "dependencies": { 345 | "html-escaper": "^2.0.0", 346 | "istanbul-lib-report": "^3.0.0" 347 | }, 348 | "engines": { 349 | "node": ">=8" 350 | } 351 | }, 352 | "node_modules/kleur": { 353 | "version": "4.1.4", 354 | "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.4.tgz", 355 | "integrity": "sha512-8QADVssbrFjivHWQU7KkMgptGTl6WAcSdlbBPY4uNF+mWr6DGcKrvY2w4FQJoXch7+fKMjj0dRrL75vk3k23OA==", 356 | "dev": true, 357 | "engines": { 358 | "node": ">=6" 359 | } 360 | }, 361 | "node_modules/locate-path": { 362 | "version": "6.0.0", 363 | "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", 364 | "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", 365 | "dev": true, 366 | "dependencies": { 367 | "p-locate": "^5.0.0" 368 | }, 369 | "engines": { 370 | "node": ">=10" 371 | }, 372 | "funding": { 373 | "url": "https://github.com/sponsors/sindresorhus" 374 | } 375 | }, 376 | "node_modules/make-dir": { 377 | "version": "3.1.0", 378 | "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", 379 | "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", 380 | "dev": true, 381 | "dependencies": { 382 | "semver": "^6.0.0" 383 | }, 384 | "engines": { 385 | "node": ">=8" 386 | }, 387 | "funding": { 388 | "url": "https://github.com/sponsors/sindresorhus" 389 | } 390 | }, 391 | "node_modules/minimatch": { 392 | "version": "3.0.4", 393 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", 394 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", 395 | "dev": true, 396 | "dependencies": { 397 | "brace-expansion": "^1.1.7" 398 | }, 399 | "engines": { 400 | "node": "*" 401 | } 402 | }, 403 | "node_modules/mri": { 404 | "version": "1.2.0", 405 | "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", 406 | "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", 407 | "dev": true, 408 | "engines": { 409 | "node": ">=4" 410 | } 411 | }, 412 | "node_modules/once": { 413 | "version": "1.4.0", 414 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 415 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 416 | "dev": true, 417 | "dependencies": { 418 | "wrappy": "1" 419 | } 420 | }, 421 | "node_modules/p-limit": { 422 | "version": "3.1.0", 423 | "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", 424 | "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", 425 | "dev": true, 426 | "dependencies": { 427 | "yocto-queue": "^0.1.0" 428 | }, 429 | "engines": { 430 | "node": ">=10" 431 | }, 432 | "funding": { 433 | "url": "https://github.com/sponsors/sindresorhus" 434 | } 435 | }, 436 | "node_modules/p-locate": { 437 | "version": "5.0.0", 438 | "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", 439 | "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", 440 | "dev": true, 441 | "dependencies": { 442 | "p-limit": "^3.0.2" 443 | }, 444 | "engines": { 445 | "node": ">=10" 446 | }, 447 | "funding": { 448 | "url": "https://github.com/sponsors/sindresorhus" 449 | } 450 | }, 451 | "node_modules/path-exists": { 452 | "version": "4.0.0", 453 | "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", 454 | "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", 455 | "dev": true, 456 | "engines": { 457 | "node": ">=8" 458 | } 459 | }, 460 | "node_modules/path-is-absolute": { 461 | "version": "1.0.1", 462 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 463 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", 464 | "dev": true, 465 | "engines": { 466 | "node": ">=0.10.0" 467 | } 468 | }, 469 | "node_modules/path-key": { 470 | "version": "3.1.1", 471 | "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", 472 | "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", 473 | "dev": true, 474 | "engines": { 475 | "node": ">=8" 476 | } 477 | }, 478 | "node_modules/require-directory": { 479 | "version": "2.1.1", 480 | "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", 481 | "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", 482 | "dev": true, 483 | "engines": { 484 | "node": ">=0.10.0" 485 | } 486 | }, 487 | "node_modules/rimraf": { 488 | "version": "3.0.2", 489 | "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", 490 | "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", 491 | "dev": true, 492 | "dependencies": { 493 | "glob": "^7.1.3" 494 | }, 495 | "bin": { 496 | "rimraf": "bin.js" 497 | }, 498 | "funding": { 499 | "url": "https://github.com/sponsors/isaacs" 500 | } 501 | }, 502 | "node_modules/sade": { 503 | "version": "1.7.4", 504 | "resolved": "https://registry.npmjs.org/sade/-/sade-1.7.4.tgz", 505 | "integrity": "sha512-y5yauMD93rX840MwUJr7C1ysLFBgMspsdTo4UVrDg3fXDvtwOyIqykhVAAm6fk/3au77773itJStObgK+LKaiA==", 506 | "dev": true, 507 | "dependencies": { 508 | "mri": "^1.1.0" 509 | }, 510 | "engines": { 511 | "node": ">= 6" 512 | } 513 | }, 514 | "node_modules/safe-buffer": { 515 | "version": "5.1.2", 516 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 517 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", 518 | "dev": true 519 | }, 520 | "node_modules/semver": { 521 | "version": "6.3.0", 522 | "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", 523 | "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", 524 | "dev": true, 525 | "bin": { 526 | "semver": "bin/semver.js" 527 | } 528 | }, 529 | "node_modules/shebang-command": { 530 | "version": "2.0.0", 531 | "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", 532 | "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", 533 | "dev": true, 534 | "dependencies": { 535 | "shebang-regex": "^3.0.0" 536 | }, 537 | "engines": { 538 | "node": ">=8" 539 | } 540 | }, 541 | "node_modules/shebang-regex": { 542 | "version": "3.0.0", 543 | "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", 544 | "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", 545 | "dev": true, 546 | "engines": { 547 | "node": ">=8" 548 | } 549 | }, 550 | "node_modules/signal-exit": { 551 | "version": "3.0.5", 552 | "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.5.tgz", 553 | "integrity": "sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ==", 554 | "dev": true 555 | }, 556 | "node_modules/string-width": { 557 | "version": "4.2.3", 558 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", 559 | "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", 560 | "dev": true, 561 | "dependencies": { 562 | "emoji-regex": "^8.0.0", 563 | "is-fullwidth-code-point": "^3.0.0", 564 | "strip-ansi": "^6.0.1" 565 | }, 566 | "engines": { 567 | "node": ">=8" 568 | } 569 | }, 570 | "node_modules/strip-ansi": { 571 | "version": "6.0.1", 572 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", 573 | "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", 574 | "dev": true, 575 | "dependencies": { 576 | "ansi-regex": "^5.0.1" 577 | }, 578 | "engines": { 579 | "node": ">=8" 580 | } 581 | }, 582 | "node_modules/test-exclude": { 583 | "version": "6.0.0", 584 | "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", 585 | "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", 586 | "dev": true, 587 | "dependencies": { 588 | "@istanbuljs/schema": "^0.1.2", 589 | "glob": "^7.1.4", 590 | "minimatch": "^3.0.4" 591 | }, 592 | "engines": { 593 | "node": ">=8" 594 | } 595 | }, 596 | "node_modules/totalist": { 597 | "version": "2.0.0", 598 | "resolved": "https://registry.npmjs.org/totalist/-/totalist-2.0.0.tgz", 599 | "integrity": "sha512-+Y17F0YzxfACxTyjfhnJQEe7afPA0GSpYlFkl2VFMxYP7jshQf9gXV7cH47EfToBumFThfKBvfAcoUn6fdNeRQ==", 600 | "dev": true, 601 | "engines": { 602 | "node": ">=6" 603 | } 604 | }, 605 | "node_modules/typescript": { 606 | "version": "4.4.4", 607 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", 608 | "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==", 609 | "dev": true, 610 | "bin": { 611 | "tsc": "bin/tsc", 612 | "tsserver": "bin/tsserver" 613 | }, 614 | "engines": { 615 | "node": ">=4.2.0" 616 | } 617 | }, 618 | "node_modules/uvu": { 619 | "version": "0.5.2", 620 | "resolved": "https://registry.npmjs.org/uvu/-/uvu-0.5.2.tgz", 621 | "integrity": "sha512-m2hLe7I2eROhh+tm3WE5cTo/Cv3WQA7Oc9f7JB6uWv+/zVKvfAm53bMyOoGOSZeQ7Ov2Fu9pLhFr7p07bnT20w==", 622 | "dev": true, 623 | "dependencies": { 624 | "dequal": "^2.0.0", 625 | "diff": "^5.0.0", 626 | "kleur": "^4.0.3", 627 | "sade": "^1.7.3", 628 | "totalist": "^2.0.0" 629 | }, 630 | "bin": { 631 | "uvu": "bin.js" 632 | }, 633 | "engines": { 634 | "node": ">=8" 635 | } 636 | }, 637 | "node_modules/uvu/node_modules/diff": { 638 | "version": "5.0.0", 639 | "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", 640 | "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", 641 | "dev": true, 642 | "engines": { 643 | "node": ">=0.3.1" 644 | } 645 | }, 646 | "node_modules/v8-to-istanbul": { 647 | "version": "8.1.0", 648 | "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-8.1.0.tgz", 649 | "integrity": "sha512-/PRhfd8aTNp9Ggr62HPzXg2XasNFGy5PBt0Rp04du7/8GNNSgxFL6WBTkgMKSL9bFjH+8kKEG3f37FmxiTqUUA==", 650 | "dev": true, 651 | "dependencies": { 652 | "@types/istanbul-lib-coverage": "^2.0.1", 653 | "convert-source-map": "^1.6.0", 654 | "source-map": "^0.7.3" 655 | }, 656 | "engines": { 657 | "node": ">=10.12.0" 658 | } 659 | }, 660 | "node_modules/v8-to-istanbul/node_modules/convert-source-map": { 661 | "version": "1.8.0", 662 | "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", 663 | "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", 664 | "dev": true, 665 | "dependencies": { 666 | "safe-buffer": "~5.1.1" 667 | } 668 | }, 669 | "node_modules/v8-to-istanbul/node_modules/source-map": { 670 | "version": "0.7.3", 671 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", 672 | "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", 673 | "dev": true, 674 | "engines": { 675 | "node": ">= 8" 676 | } 677 | }, 678 | "node_modules/which": { 679 | "version": "2.0.2", 680 | "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", 681 | "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", 682 | "dev": true, 683 | "dependencies": { 684 | "isexe": "^2.0.0" 685 | }, 686 | "bin": { 687 | "node-which": "bin/node-which" 688 | }, 689 | "engines": { 690 | "node": ">= 8" 691 | } 692 | }, 693 | "node_modules/wrap-ansi": { 694 | "version": "7.0.0", 695 | "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", 696 | "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", 697 | "dev": true, 698 | "dependencies": { 699 | "ansi-styles": "^4.0.0", 700 | "string-width": "^4.1.0", 701 | "strip-ansi": "^6.0.0" 702 | }, 703 | "engines": { 704 | "node": ">=10" 705 | }, 706 | "funding": { 707 | "url": "https://github.com/chalk/wrap-ansi?sponsor=1" 708 | } 709 | }, 710 | "node_modules/wrappy": { 711 | "version": "1.0.2", 712 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 713 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", 714 | "dev": true 715 | }, 716 | "node_modules/y18n": { 717 | "version": "5.0.8", 718 | "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", 719 | "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", 720 | "dev": true, 721 | "engines": { 722 | "node": ">=10" 723 | } 724 | }, 725 | "node_modules/yargs": { 726 | "version": "16.2.0", 727 | "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", 728 | "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", 729 | "dev": true, 730 | "dependencies": { 731 | "cliui": "^7.0.2", 732 | "escalade": "^3.1.1", 733 | "get-caller-file": "^2.0.5", 734 | "require-directory": "^2.1.1", 735 | "string-width": "^4.2.0", 736 | "y18n": "^5.0.5", 737 | "yargs-parser": "^20.2.2" 738 | }, 739 | "engines": { 740 | "node": ">=10" 741 | } 742 | }, 743 | "node_modules/yargs-parser": { 744 | "version": "20.2.9", 745 | "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", 746 | "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", 747 | "dev": true, 748 | "engines": { 749 | "node": ">=10" 750 | } 751 | }, 752 | "node_modules/yocto-queue": { 753 | "version": "0.1.0", 754 | "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", 755 | "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", 756 | "dev": true, 757 | "engines": { 758 | "node": ">=10" 759 | }, 760 | "funding": { 761 | "url": "https://github.com/sponsors/sindresorhus" 762 | } 763 | } 764 | }, 765 | "dependencies": { 766 | "@bcoe/v8-coverage": { 767 | "version": "0.2.3", 768 | "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", 769 | "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", 770 | "dev": true 771 | }, 772 | "@istanbuljs/schema": { 773 | "version": "0.1.3", 774 | "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", 775 | "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", 776 | "dev": true 777 | }, 778 | "@types/istanbul-lib-coverage": { 779 | "version": "2.0.3", 780 | "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", 781 | "integrity": "sha512-sz7iLqvVUg1gIedBOvlkxPlc8/uVzyS5OwGz1cKjXzkl3FpL3al0crU8YGU1WoHkxn0Wxbw5tyi6hvzJKNzFsw==", 782 | "dev": true 783 | }, 784 | "@types/node": { 785 | "version": "9.6.61", 786 | "resolved": "https://registry.npmjs.org/@types/node/-/node-9.6.61.tgz", 787 | "integrity": "sha512-/aKAdg5c8n468cYLy2eQrcR5k6chlbNwZNGUj3TboyPa2hcO2QAJcfymlqPzMiRj8B6nYKXjzQz36minFE0RwQ==", 788 | "dev": true 789 | }, 790 | "@xmldom/xmldom": { 791 | "version": "0.7.5", 792 | "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.7.5.tgz", 793 | "integrity": "sha512-V3BIhmY36fXZ1OtVcI9W+FxQqxVLsPKcNjWigIaa81dLC9IolJl5Mt4Cvhmr0flUnjSpTdrbMTSbXqYqV5dT6A==" 794 | }, 795 | "ansi-regex": { 796 | "version": "5.0.1", 797 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", 798 | "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", 799 | "dev": true 800 | }, 801 | "ansi-styles": { 802 | "version": "4.3.0", 803 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", 804 | "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", 805 | "dev": true, 806 | "requires": { 807 | "color-convert": "^2.0.1" 808 | } 809 | }, 810 | "balanced-match": { 811 | "version": "1.0.0", 812 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", 813 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", 814 | "dev": true 815 | }, 816 | "brace-expansion": { 817 | "version": "1.1.11", 818 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 819 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 820 | "dev": true, 821 | "requires": { 822 | "balanced-match": "^1.0.0", 823 | "concat-map": "0.0.1" 824 | } 825 | }, 826 | "c8": { 827 | "version": "7.10.0", 828 | "resolved": "https://registry.npmjs.org/c8/-/c8-7.10.0.tgz", 829 | "integrity": "sha512-OAwfC5+emvA6R7pkYFVBTOtI5ruf9DahffGmIqUc9l6wEh0h7iAFP6dt/V9Ioqlr2zW5avX9U9/w1I4alTRHkA==", 830 | "dev": true, 831 | "requires": { 832 | "@bcoe/v8-coverage": "^0.2.3", 833 | "@istanbuljs/schema": "^0.1.2", 834 | "find-up": "^5.0.0", 835 | "foreground-child": "^2.0.0", 836 | "istanbul-lib-coverage": "^3.0.1", 837 | "istanbul-lib-report": "^3.0.0", 838 | "istanbul-reports": "^3.0.2", 839 | "rimraf": "^3.0.0", 840 | "test-exclude": "^6.0.0", 841 | "v8-to-istanbul": "^8.0.0", 842 | "yargs": "^16.2.0", 843 | "yargs-parser": "^20.2.7" 844 | } 845 | }, 846 | "cliui": { 847 | "version": "7.0.4", 848 | "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", 849 | "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", 850 | "dev": true, 851 | "requires": { 852 | "string-width": "^4.2.0", 853 | "strip-ansi": "^6.0.0", 854 | "wrap-ansi": "^7.0.0" 855 | } 856 | }, 857 | "color-convert": { 858 | "version": "2.0.1", 859 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", 860 | "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", 861 | "dev": true, 862 | "requires": { 863 | "color-name": "~1.1.4" 864 | } 865 | }, 866 | "color-name": { 867 | "version": "1.1.4", 868 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", 869 | "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", 870 | "dev": true 871 | }, 872 | "concat-map": { 873 | "version": "0.0.1", 874 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 875 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", 876 | "dev": true 877 | }, 878 | "cross-spawn": { 879 | "version": "7.0.3", 880 | "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", 881 | "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", 882 | "dev": true, 883 | "requires": { 884 | "path-key": "^3.1.0", 885 | "shebang-command": "^2.0.0", 886 | "which": "^2.0.1" 887 | } 888 | }, 889 | "dequal": { 890 | "version": "2.0.2", 891 | "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.2.tgz", 892 | "integrity": "sha512-q9K8BlJVxK7hQYqa6XISGmBZbtQQWVXSrRrWreHC94rMt1QL/Impruc+7p2CYSYuVIUr+YCt6hjrs1kkdJRTug==", 893 | "dev": true 894 | }, 895 | "emoji-regex": { 896 | "version": "8.0.0", 897 | "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", 898 | "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", 899 | "dev": true 900 | }, 901 | "escalade": { 902 | "version": "3.1.1", 903 | "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", 904 | "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", 905 | "dev": true 906 | }, 907 | "find-up": { 908 | "version": "5.0.0", 909 | "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", 910 | "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", 911 | "dev": true, 912 | "requires": { 913 | "locate-path": "^6.0.0", 914 | "path-exists": "^4.0.0" 915 | } 916 | }, 917 | "foreground-child": { 918 | "version": "2.0.0", 919 | "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", 920 | "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", 921 | "dev": true, 922 | "requires": { 923 | "cross-spawn": "^7.0.0", 924 | "signal-exit": "^3.0.2" 925 | } 926 | }, 927 | "fs.realpath": { 928 | "version": "1.0.0", 929 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 930 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", 931 | "dev": true 932 | }, 933 | "get-caller-file": { 934 | "version": "2.0.5", 935 | "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", 936 | "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", 937 | "dev": true 938 | }, 939 | "glob": { 940 | "version": "7.2.0", 941 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", 942 | "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", 943 | "dev": true, 944 | "requires": { 945 | "fs.realpath": "^1.0.0", 946 | "inflight": "^1.0.4", 947 | "inherits": "2", 948 | "minimatch": "^3.0.4", 949 | "once": "^1.3.0", 950 | "path-is-absolute": "^1.0.0" 951 | } 952 | }, 953 | "html-escaper": { 954 | "version": "2.0.2", 955 | "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", 956 | "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", 957 | "dev": true 958 | }, 959 | "inflight": { 960 | "version": "1.0.6", 961 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 962 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 963 | "dev": true, 964 | "requires": { 965 | "once": "^1.3.0", 966 | "wrappy": "1" 967 | } 968 | }, 969 | "inherits": { 970 | "version": "2.0.3", 971 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 972 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", 973 | "dev": true 974 | }, 975 | "is-fullwidth-code-point": { 976 | "version": "3.0.0", 977 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", 978 | "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", 979 | "dev": true 980 | }, 981 | "isexe": { 982 | "version": "2.0.0", 983 | "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", 984 | "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", 985 | "dev": true 986 | }, 987 | "istanbul-lib-coverage": { 988 | "version": "3.2.0", 989 | "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", 990 | "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", 991 | "dev": true 992 | }, 993 | "istanbul-lib-report": { 994 | "version": "3.0.0", 995 | "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", 996 | "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", 997 | "dev": true, 998 | "requires": { 999 | "istanbul-lib-coverage": "^3.0.0", 1000 | "make-dir": "^3.0.0", 1001 | "supports-color": "^7.1.0" 1002 | }, 1003 | "dependencies": { 1004 | "has-flag": { 1005 | "version": "4.0.0", 1006 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", 1007 | "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", 1008 | "dev": true 1009 | }, 1010 | "supports-color": { 1011 | "version": "7.2.0", 1012 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", 1013 | "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", 1014 | "dev": true, 1015 | "requires": { 1016 | "has-flag": "^4.0.0" 1017 | } 1018 | } 1019 | } 1020 | }, 1021 | "istanbul-reports": { 1022 | "version": "3.0.5", 1023 | "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.5.tgz", 1024 | "integrity": "sha512-5+19PlhnGabNWB7kOFnuxT8H3T/iIyQzIbQMxXsURmmvKg86P2sbkrGOT77VnHw0Qr0gc2XzRaRfMZYYbSQCJQ==", 1025 | "dev": true, 1026 | "requires": { 1027 | "html-escaper": "^2.0.0", 1028 | "istanbul-lib-report": "^3.0.0" 1029 | } 1030 | }, 1031 | "kleur": { 1032 | "version": "4.1.4", 1033 | "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.4.tgz", 1034 | "integrity": "sha512-8QADVssbrFjivHWQU7KkMgptGTl6WAcSdlbBPY4uNF+mWr6DGcKrvY2w4FQJoXch7+fKMjj0dRrL75vk3k23OA==", 1035 | "dev": true 1036 | }, 1037 | "locate-path": { 1038 | "version": "6.0.0", 1039 | "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", 1040 | "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", 1041 | "dev": true, 1042 | "requires": { 1043 | "p-locate": "^5.0.0" 1044 | } 1045 | }, 1046 | "make-dir": { 1047 | "version": "3.1.0", 1048 | "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", 1049 | "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", 1050 | "dev": true, 1051 | "requires": { 1052 | "semver": "^6.0.0" 1053 | } 1054 | }, 1055 | "minimatch": { 1056 | "version": "3.0.4", 1057 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", 1058 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", 1059 | "dev": true, 1060 | "requires": { 1061 | "brace-expansion": "^1.1.7" 1062 | } 1063 | }, 1064 | "mri": { 1065 | "version": "1.2.0", 1066 | "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", 1067 | "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", 1068 | "dev": true 1069 | }, 1070 | "once": { 1071 | "version": "1.4.0", 1072 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 1073 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 1074 | "dev": true, 1075 | "requires": { 1076 | "wrappy": "1" 1077 | } 1078 | }, 1079 | "p-limit": { 1080 | "version": "3.1.0", 1081 | "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", 1082 | "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", 1083 | "dev": true, 1084 | "requires": { 1085 | "yocto-queue": "^0.1.0" 1086 | } 1087 | }, 1088 | "p-locate": { 1089 | "version": "5.0.0", 1090 | "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", 1091 | "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", 1092 | "dev": true, 1093 | "requires": { 1094 | "p-limit": "^3.0.2" 1095 | } 1096 | }, 1097 | "path-exists": { 1098 | "version": "4.0.0", 1099 | "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", 1100 | "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", 1101 | "dev": true 1102 | }, 1103 | "path-is-absolute": { 1104 | "version": "1.0.1", 1105 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 1106 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", 1107 | "dev": true 1108 | }, 1109 | "path-key": { 1110 | "version": "3.1.1", 1111 | "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", 1112 | "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", 1113 | "dev": true 1114 | }, 1115 | "require-directory": { 1116 | "version": "2.1.1", 1117 | "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", 1118 | "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", 1119 | "dev": true 1120 | }, 1121 | "rimraf": { 1122 | "version": "3.0.2", 1123 | "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", 1124 | "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", 1125 | "dev": true, 1126 | "requires": { 1127 | "glob": "^7.1.3" 1128 | } 1129 | }, 1130 | "sade": { 1131 | "version": "1.7.4", 1132 | "resolved": "https://registry.npmjs.org/sade/-/sade-1.7.4.tgz", 1133 | "integrity": "sha512-y5yauMD93rX840MwUJr7C1ysLFBgMspsdTo4UVrDg3fXDvtwOyIqykhVAAm6fk/3au77773itJStObgK+LKaiA==", 1134 | "dev": true, 1135 | "requires": { 1136 | "mri": "^1.1.0" 1137 | } 1138 | }, 1139 | "safe-buffer": { 1140 | "version": "5.1.2", 1141 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 1142 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", 1143 | "dev": true 1144 | }, 1145 | "semver": { 1146 | "version": "6.3.0", 1147 | "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", 1148 | "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", 1149 | "dev": true 1150 | }, 1151 | "shebang-command": { 1152 | "version": "2.0.0", 1153 | "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", 1154 | "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", 1155 | "dev": true, 1156 | "requires": { 1157 | "shebang-regex": "^3.0.0" 1158 | } 1159 | }, 1160 | "shebang-regex": { 1161 | "version": "3.0.0", 1162 | "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", 1163 | "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", 1164 | "dev": true 1165 | }, 1166 | "signal-exit": { 1167 | "version": "3.0.5", 1168 | "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.5.tgz", 1169 | "integrity": "sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ==", 1170 | "dev": true 1171 | }, 1172 | "string-width": { 1173 | "version": "4.2.3", 1174 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", 1175 | "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", 1176 | "dev": true, 1177 | "requires": { 1178 | "emoji-regex": "^8.0.0", 1179 | "is-fullwidth-code-point": "^3.0.0", 1180 | "strip-ansi": "^6.0.1" 1181 | } 1182 | }, 1183 | "strip-ansi": { 1184 | "version": "6.0.1", 1185 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", 1186 | "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", 1187 | "dev": true, 1188 | "requires": { 1189 | "ansi-regex": "^5.0.1" 1190 | } 1191 | }, 1192 | "test-exclude": { 1193 | "version": "6.0.0", 1194 | "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", 1195 | "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", 1196 | "dev": true, 1197 | "requires": { 1198 | "@istanbuljs/schema": "^0.1.2", 1199 | "glob": "^7.1.4", 1200 | "minimatch": "^3.0.4" 1201 | } 1202 | }, 1203 | "totalist": { 1204 | "version": "2.0.0", 1205 | "resolved": "https://registry.npmjs.org/totalist/-/totalist-2.0.0.tgz", 1206 | "integrity": "sha512-+Y17F0YzxfACxTyjfhnJQEe7afPA0GSpYlFkl2VFMxYP7jshQf9gXV7cH47EfToBumFThfKBvfAcoUn6fdNeRQ==", 1207 | "dev": true 1208 | }, 1209 | "typescript": { 1210 | "version": "4.4.4", 1211 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", 1212 | "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==", 1213 | "dev": true 1214 | }, 1215 | "uvu": { 1216 | "version": "0.5.2", 1217 | "resolved": "https://registry.npmjs.org/uvu/-/uvu-0.5.2.tgz", 1218 | "integrity": "sha512-m2hLe7I2eROhh+tm3WE5cTo/Cv3WQA7Oc9f7JB6uWv+/zVKvfAm53bMyOoGOSZeQ7Ov2Fu9pLhFr7p07bnT20w==", 1219 | "dev": true, 1220 | "requires": { 1221 | "dequal": "^2.0.0", 1222 | "diff": "^5.0.0", 1223 | "kleur": "^4.0.3", 1224 | "sade": "^1.7.3", 1225 | "totalist": "^2.0.0" 1226 | }, 1227 | "dependencies": { 1228 | "diff": { 1229 | "version": "5.0.0", 1230 | "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", 1231 | "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", 1232 | "dev": true 1233 | } 1234 | } 1235 | }, 1236 | "v8-to-istanbul": { 1237 | "version": "8.1.0", 1238 | "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-8.1.0.tgz", 1239 | "integrity": "sha512-/PRhfd8aTNp9Ggr62HPzXg2XasNFGy5PBt0Rp04du7/8GNNSgxFL6WBTkgMKSL9bFjH+8kKEG3f37FmxiTqUUA==", 1240 | "dev": true, 1241 | "requires": { 1242 | "@types/istanbul-lib-coverage": "^2.0.1", 1243 | "convert-source-map": "^1.6.0", 1244 | "source-map": "^0.7.3" 1245 | }, 1246 | "dependencies": { 1247 | "convert-source-map": { 1248 | "version": "1.8.0", 1249 | "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", 1250 | "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", 1251 | "dev": true, 1252 | "requires": { 1253 | "safe-buffer": "~5.1.1" 1254 | } 1255 | }, 1256 | "source-map": { 1257 | "version": "0.7.3", 1258 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", 1259 | "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", 1260 | "dev": true 1261 | } 1262 | } 1263 | }, 1264 | "which": { 1265 | "version": "2.0.2", 1266 | "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", 1267 | "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", 1268 | "dev": true, 1269 | "requires": { 1270 | "isexe": "^2.0.0" 1271 | } 1272 | }, 1273 | "wrap-ansi": { 1274 | "version": "7.0.0", 1275 | "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", 1276 | "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", 1277 | "dev": true, 1278 | "requires": { 1279 | "ansi-styles": "^4.0.0", 1280 | "string-width": "^4.1.0", 1281 | "strip-ansi": "^6.0.0" 1282 | } 1283 | }, 1284 | "wrappy": { 1285 | "version": "1.0.2", 1286 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 1287 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", 1288 | "dev": true 1289 | }, 1290 | "y18n": { 1291 | "version": "5.0.8", 1292 | "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", 1293 | "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", 1294 | "dev": true 1295 | }, 1296 | "yargs": { 1297 | "version": "16.2.0", 1298 | "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", 1299 | "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", 1300 | "dev": true, 1301 | "requires": { 1302 | "cliui": "^7.0.2", 1303 | "escalade": "^3.1.1", 1304 | "get-caller-file": "^2.0.5", 1305 | "require-directory": "^2.1.1", 1306 | "string-width": "^4.2.0", 1307 | "y18n": "^5.0.5", 1308 | "yargs-parser": "^20.2.2" 1309 | } 1310 | }, 1311 | "yargs-parser": { 1312 | "version": "20.2.9", 1313 | "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", 1314 | "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", 1315 | "dev": true 1316 | }, 1317 | "yocto-queue": { 1318 | "version": "0.1.0", 1319 | "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", 1320 | "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", 1321 | "dev": true 1322 | } 1323 | } 1324 | } 1325 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "camljs", 3 | "version": "2.12.1", 4 | "description": "Library for creating SharePoint CAML queries client-side. For JSOM, REST or SPServices.", 5 | "main": "dist/camljs.js", 6 | "types": "dist/camljs.d.ts", 7 | "directories": { 8 | "lib": "lib", 9 | "test": "tests" 10 | }, 11 | "scripts": { 12 | "build": "tsc && node postbuild.js", 13 | "test": "uvu tests", 14 | "test:coverage": "c8 --include=lib npm test", 15 | "clean": "del tests\\Tests.js && del tests\\Tests.bundle.js && del dist\\*.* /Q" 16 | }, 17 | "files": [ 18 | "dist/camljs.js", 19 | "dist/camljs.d.ts" 20 | ], 21 | "repository": { 22 | "type": "git", 23 | "url": "git+https://github.com/andrei-markeev/camljs.git" 24 | }, 25 | "keywords": [ 26 | "sharepoint", 27 | "caml" 28 | ], 29 | "author": "Andrei Markeev", 30 | "license": "MS-PL", 31 | "bugs": { 32 | "url": "https://github.com/andrei-markeev/camljs/issues" 33 | }, 34 | "homepage": "https://github.com/andrei-markeev/camljs#readme", 35 | "devDependencies": { 36 | "@types/node": "^9.6.61", 37 | "c8": "^7.10.0", 38 | "typescript": "^4.4.4", 39 | "uvu": "^0.5.2" 40 | }, 41 | "dependencies": { 42 | "@xmldom/xmldom": "^0.7.5" 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /postbuild.js: -------------------------------------------------------------------------------- 1 | /// @ts-check 2 | 3 | var fs = require("fs"); 4 | 5 | var contents = fs.readFileSync("dist/camljs.js", "utf8"); 6 | 7 | if (contents.indexOf("(function (f) {") !== 0) { 8 | 9 | contents = `(function (f) { 10 | if (typeof exports === "object" && typeof module !== "undefined") { 11 | module.exports = f() 12 | } else if (typeof define === "function" && define.amd) { 13 | define([], f) 14 | } else { 15 | var g; 16 | if (typeof window !== "undefined") g = window 17 | else if (typeof global !== "undefined") g = global 18 | else if (typeof self !== "undefined") g = self 19 | else g = this; 20 | g.CamlBuilder = f() 21 | } 22 | })(function () { 23 | 24 | var m = {}; 25 | 26 | (function(module) { 27 | ${contents} 28 | })(m); 29 | 30 | return m.exports; 31 | 32 | });`; 33 | 34 | fs.writeFileSync("dist/camljs.js", contents, "utf8"); 35 | 36 | } -------------------------------------------------------------------------------- /tests/aggregations.js: -------------------------------------------------------------------------------- 1 | /// @ts-check 2 | 3 | var assert = require("uvu/assert"); 4 | var test = require("uvu").test; 5 | var CamlBuilder = require("../dist/camljs"); 6 | var vkbeautify = require("./vkbeautify"); 7 | 8 | test("Aggregations", () => { 9 | var query = new CamlBuilder() 10 | .View(["Category", { count: "ID" }, { sum: "Amount" }]) 11 | .Query() 12 | .GroupBy("Category", true, 100) 13 | .ToString(); 14 | 15 | 16 | assert.equal( 17 | vkbeautify.xml(query), 18 | vkbeautify.xml( 19 | '\ 20 | \ 21 | \ 22 | \ 23 | \ 24 | \ 25 | \ 26 | \ 27 | \ 28 | \ 29 | \ 30 | \ 31 | \ 32 | ') 33 | ); 34 | }); 35 | 36 | test.run(); 37 | -------------------------------------------------------------------------------- /tests/basics.js: -------------------------------------------------------------------------------- 1 | /// @ts-check 2 | 3 | var assert = require("uvu/assert"); 4 | var test = require("uvu").test; 5 | var CamlBuilder = require("../dist/camljs"); 6 | var vkbeautify = require("./vkbeautify"); 7 | 8 | test("EmptyView", () => { 9 | var query = new CamlBuilder().View().ToString(); 10 | assert.equal(query, ""); 11 | }); 12 | 13 | test("SimpleWhere", () => { 14 | var query = new CamlBuilder().Where().CounterField("ID").EqualTo(10).ToString(); 15 | assert.equal(query, `10`); 16 | }); 17 | 18 | test("OrChaining", () => { 19 | var caml = new CamlBuilder().Where() 20 | .TextField("Email").EqualTo("support@google.com") 21 | .Or() 22 | .TextField("Email").EqualTo("plus@google.com") 23 | .Or() 24 | .TextField("Title").BeginsWith("[Google]") 25 | .Or() 26 | .TextField("Content").Contains("Google") 27 | .ToString(); 28 | 29 | assert.equal( 30 | vkbeautify.xml(caml), 31 | vkbeautify.xml( 32 | ` 33 | 34 | 35 | 36 | support@google.com 37 | 38 | 39 | 40 | 41 | plus@google.com 42 | 43 | 44 | 45 | 46 | [Google] 47 | 48 | 49 | 50 | Google 51 | 52 | 53 | 54 | 55 | ` 56 | ) 57 | ) 58 | }); 59 | 60 | test("LookupIdAndOrderBy", () => { 61 | var caml = new CamlBuilder().Where() 62 | .LookupField("Category").Id().In([2, 3, 10]) 63 | .And() 64 | .DateField("ExpirationDate").GreaterThan(CamlBuilder.CamlValues.Now) 65 | .OrderBy("ExpirationDate") 66 | .ToString() 67 | 68 | assert.equal( 69 | vkbeautify.xml(caml), 70 | vkbeautify.xml( 71 | '\ 72 | \ 73 | \ 74 | \ 75 | \ 76 | 2\ 77 | 3\ 78 | 10\ 79 | \ 80 | \ 81 | \ 82 | \ 83 | \ 84 | \ 85 | \ 86 | \ 87 | \ 88 | \ 89 | \ 90 | \ 91 | ') 92 | ); 93 | }); 94 | 95 | test("InCounter", () => { 96 | var caml = new CamlBuilder().Where().CounterField("ID").In([1, 2, 3]).ToString(); 97 | 98 | assert.equal( 99 | vkbeautify.xml(caml), 100 | vkbeautify.xml( 101 | '\ 102 | \ 103 | \ 104 | \ 105 | 1\ 106 | 2\ 107 | 3\ 108 | \ 109 | \ 110 | ') 111 | ); 112 | 113 | }); 114 | 115 | test("JsDateFormat", () => { 116 | var caml = new CamlBuilder().Where().DateTimeField("Created").GreaterThan(new Date(Date.UTC(2013,0,1))).ToString(); 117 | 118 | assert.equal( 119 | vkbeautify.xml(caml), 120 | vkbeautify.xml( 121 | '\ 122 | \ 123 | \ 124 | 2013-01-01T00:00:00.000Z\ 125 | \ 126 | ') 127 | ); 128 | }); 129 | 130 | test("TodayWithOffset", () => { 131 | var caml = new CamlBuilder().Where().DateField("Modified").LessThan(CamlBuilder.CamlValues.TodayWithOffset(-3)).ToString(); 132 | 133 | assert.equal( 134 | vkbeautify.xml(caml), 135 | vkbeautify.xml( 136 | ` 137 | 138 | 139 | 140 | 141 | 142 | 143 | ` 144 | ) 145 | ) 146 | }) 147 | 148 | test("RecursiveAll", () => { 149 | var query = new CamlBuilder() 150 | .View() 151 | .Scope(CamlBuilder.ViewScope.RecursiveAll) 152 | .Query() 153 | .Where() 154 | .NumberField("ID").IsNotNull() 155 | .ToString(); 156 | 157 | 158 | assert.equal( 159 | vkbeautify.xml(query), 160 | vkbeautify.xml( 161 | '\ 162 | \ 163 | \ 164 | \ 165 | \ 166 | \ 167 | \ 168 | \ 169 | '), 170 | ); 171 | 172 | }); 173 | 174 | test("QueryOrderBy", () => { 175 | var query = new CamlBuilder() 176 | .View() 177 | .Query() 178 | .OrderBy("ID") 179 | .ToString(); 180 | 181 | 182 | assert.equal( 183 | vkbeautify.xml(query), 184 | vkbeautify.xml( 185 | '\ 186 | \ 187 | \ 188 | \ 189 | \ 190 | \ 191 | ') 192 | ); 193 | 194 | }); 195 | 196 | test("OrderBy_ThenByDesc", () => { 197 | var query = new CamlBuilder() 198 | .Query() 199 | .OrderBy("Category") 200 | .ThenByDesc("Modified") 201 | .ToString(); 202 | 203 | 204 | assert.equal( 205 | vkbeautify.xml(query), 206 | vkbeautify.xml( 207 | ` 208 | 209 | 210 | 211 | 212 | ` 213 | ) 214 | ); 215 | 216 | }); 217 | 218 | test("StartFromQueryTag", () => { 219 | var query = new CamlBuilder().Query().Where().TextField("Title").BeginsWith("Hello").ToString(); 220 | assert.equal( 221 | vkbeautify.xml(query), 222 | vkbeautify.xml( 223 | ` 224 | 225 | 226 | 227 | Hello 228 | 229 | 230 | ` 231 | ) 232 | ) 233 | }); 234 | 235 | test("EmptyQuery", () => { 236 | var query = new CamlBuilder().Query().ToString(); 237 | assert.equal(query, ""); 238 | }); 239 | 240 | test("QueryOrderBy", () => { 241 | var query = new CamlBuilder().Query().OrderByDesc("Department", true, true).ToString(); 242 | assert.equal( 243 | vkbeautify.xml(query), 244 | vkbeautify.xml( 245 | ` 246 | 247 | 248 | 249 | ` 250 | ) 251 | ) 252 | }); 253 | 254 | test.run(); 255 | -------------------------------------------------------------------------------- /tests/contenttypeid.js: -------------------------------------------------------------------------------- 1 | /// @ts-check 2 | 3 | var assert = require("uvu/assert"); 4 | var test = require("uvu").test; 5 | var CamlBuilder = require("../dist/camljs"); 6 | var vkbeautify = require("./vkbeautify"); 7 | 8 | test("ContentTypeIdField", () => { 9 | var query = new CamlBuilder() 10 | .Where() 11 | .TextField("Title").EqualTo("Document") 12 | .And() 13 | .ContentTypeIdField().BeginsWith("0x101") 14 | .ToString(); 15 | 16 | assert.equal( 17 | vkbeautify.xml(query), 18 | vkbeautify.xml( 19 | ` 20 | 21 | 22 | 23 | Document 24 | 25 | 26 | 27 | 0x101 28 | 29 | 30 | `) 31 | ); 32 | 33 | }); 34 | 35 | test.run(); 36 | -------------------------------------------------------------------------------- /tests/daterangesoverlap.js: -------------------------------------------------------------------------------- 1 | /// @ts-check 2 | 3 | var assert = require("uvu/assert"); 4 | var test = require("uvu").test; 5 | var CamlBuilder = require("../dist/camljs"); 6 | var vkbeautify = require("./vkbeautify"); 7 | 8 | test("DateRangesOverlap", () => { 9 | var caml = CamlBuilder.Expression() 10 | .All( 11 | CamlBuilder.Expression().DateField("BroadcastExpires").GreaterThanOrEqualTo(CamlBuilder.CamlValues.Today), 12 | CamlBuilder.Expression().Any( 13 | CamlBuilder.Expression().UserField("BroadcastTo").IsInCurrentUserGroups(), 14 | CamlBuilder.Expression().UserField("BroadcastTo").EqualToCurrentUser() 15 | ), 16 | CamlBuilder.Expression().DateRangesOverlap(CamlBuilder.DateRangesOverlapType.Year, new Date().toISOString()) 17 | ) 18 | .ToString(); 19 | 20 | assert.equal( 21 | vkbeautify.xml(caml), 22 | vkbeautify.xml( 23 | '\ 24 | \ 25 | \ 26 | \ 27 | \ 28 | \ 29 | \ 30 | \ 31 | \ 32 | \ 33 | \ 34 | \ 35 | \ 36 | \ 37 | \ 38 | \ 39 | \ 40 | \ 41 | \ 42 | \ 43 | \ 44 | \ 45 | \ 46 | \ 47 | \ 48 | \ 49 | '), 50 | ); 51 | }); 52 | 53 | test.run(); -------------------------------------------------------------------------------- /tests/expressions.js: -------------------------------------------------------------------------------- 1 | /// @ts-check 2 | 3 | var assert = require("uvu/assert"); 4 | var test = require("uvu").test; 5 | var CamlBuilder = require("../dist/camljs"); 6 | var vkbeautify = require("./vkbeautify"); 7 | 8 | test("Any", () => { 9 | 10 | var caml = new CamlBuilder().Where() 11 | .Any( 12 | CamlBuilder.Expression().TextField("Email").EqualTo("support@google.com"), 13 | CamlBuilder.Expression().TextField("Email").EqualTo("plus@google.com"), 14 | CamlBuilder.Expression().TextField("Title").BeginsWith("[Google]"), 15 | CamlBuilder.Expression().TextField("Content").Contains("Google") 16 | ) 17 | .ToString(); 18 | 19 | assert.equal( 20 | vkbeautify.xml(caml), 21 | vkbeautify.xml( 22 | '\ 23 | \ 24 | support@google.com\ 25 | \ 26 | plus@google.com\ 27 | \ 28 | [Google]\ 29 | Google\ 30 | \ 31 | \ 32 | \ 33 | ') 34 | ); 35 | 36 | }); 37 | 38 | test("DynamicBracketExpressions", () => { 39 | var categories = ["Platform Support", "Research and Strategy"]; 40 | var purposes = ["Application and User Lists", "How To", "Support Information"]; 41 | 42 | var categoriesExpressions = []; 43 | for (var i = 0; i < categories.length; i++) { 44 | categoriesExpressions.push(CamlBuilder.Expression().TextField("ContentCategory").EqualTo(categories[i])); 45 | } 46 | var purposesExpressions = []; 47 | for (var i = 0; i < purposes.length; i++) { 48 | purposesExpressions.push(CamlBuilder.Expression().TextField("ContentPurpose").EqualTo(purposes[i])); 49 | } 50 | 51 | var caml = new CamlBuilder().Where() 52 | .All( 53 | CamlBuilder.Expression().Any(categoriesExpressions), 54 | CamlBuilder.Expression().Any(purposesExpressions) 55 | ) 56 | .ToString(); 57 | 58 | assert.equal( 59 | vkbeautify.xml(caml), 60 | vkbeautify.xml( 61 | '\ 62 | \ 63 | \ 64 | \ 65 | \ 66 | Platform Support\ 67 | \ 68 | \ 69 | \ 70 | Research and Strategy\ 71 | \ 72 | \ 73 | \ 74 | \ 75 | \ 76 | Application and User Lists\ 77 | \ 78 | \ 79 | \ 80 | \ 81 | How To\ 82 | \ 83 | \ 84 | \ 85 | Support Information\ 86 | \ 87 | \ 88 | \ 89 | \ 90 | ') 91 | ); 92 | }); 93 | 94 | test("NestedBracketExpressions", () => { 95 | 96 | var caml = new CamlBuilder().Where() 97 | .All( 98 | CamlBuilder.Expression().All( 99 | CamlBuilder.Expression().BooleanField("Enabled").IsTrue(), 100 | CamlBuilder.Expression().UserMultiField("TargetAudience").EqualTo("55").Or().UserMultiField("TargetAudience").EqualTo("66") 101 | ), 102 | CamlBuilder.Expression().Any( 103 | CamlBuilder.Expression().TextField("NotificationScope").EqualTo("77"), 104 | CamlBuilder.Expression().TextField("NotificationScope").EqualTo("88").And().TextField("ScopeWebRelativeUrl").EqualTo("99") 105 | ) 106 | ) 107 | .ToString(); 108 | 109 | assert.equal( 110 | vkbeautify.xml(caml), 111 | vkbeautify.xml( 112 | '\ 113 | \ 114 | \ 115 | 1\ 116 | \ 117 | 55\ 118 | 66\ 119 | \ 120 | \ 121 | \ 122 | 77\ 123 | \ 124 | 88\ 125 | 99\ 126 | \ 127 | \ 128 | \ 129 | ') 130 | ); 131 | 132 | }); 133 | 134 | test("ViewWithExpression", () => { 135 | 136 | var expression = CamlBuilder.Expression().BooleanField("Enabled").IsTrue(); 137 | 138 | var caml = new CamlBuilder().View().Query().Where().All(expression).OrderBy("Priority").ToString(); 139 | 140 | assert.equal( 141 | vkbeautify.xml(caml), 142 | vkbeautify.xml( 143 | '\ 144 | \ 145 | \ 146 | 1\ 147 | \ 148 | \ 149 | \ 150 | \ 151 | \ 152 | ') 153 | ); 154 | 155 | }); 156 | 157 | test("EmptyAll", () => { 158 | var expression = CamlBuilder.Expression().All([ 159 | CamlBuilder.Expression().ModStatField("_ModerationStatus").ModStatId().EqualTo(0), 160 | CamlBuilder.Expression().All([]) 161 | ]).ToString() 162 | 163 | assert.equal( 164 | vkbeautify.xml( 165 | ` 166 | 167 | 0 168 | `), 169 | vkbeautify.xml(expression) 170 | ); 171 | 172 | expression = CamlBuilder.Expression().Any([ 173 | CamlBuilder.Expression().TextField("Title").Contains("test"), 174 | CamlBuilder.Expression().All([ 175 | CamlBuilder.Expression().Any([]), 176 | CamlBuilder.Expression().UrlField("Link").IsNull(), 177 | ]) 178 | ]).ToString() 179 | 180 | assert.equal( 181 | vkbeautify.xml(expression), 182 | vkbeautify.xml( 183 | ` 184 | 185 | 186 | test 187 | 188 | 189 | 190 | 191 | `) 192 | ); 193 | }); 194 | 195 | test.run(); -------------------------------------------------------------------------------- /tests/finalize.js: -------------------------------------------------------------------------------- 1 | /// @ts-check 2 | 3 | var assert = require("uvu/assert"); 4 | var test = require("uvu").test; 5 | var CamlBuilder = require("../dist/camljs"); 6 | var vkbeautify = require("./vkbeautify"); 7 | 8 | 9 | test("ToCamlQuery", () => { 10 | let setXml = ""; 11 | (global || window)["SP"] = { 12 | CamlQuery: function() { 13 | this.set_viewXml = (xml) => setXml = xml; 14 | } 15 | }; 16 | 17 | var queryText = new CamlBuilder().View(["Title", "Author"]).ToString(); 18 | var camlQuery = new CamlBuilder().View(["Title", "Author"]).ToCamlQuery(); 19 | assert.equal(queryText, setXml); 20 | 21 | queryText = new CamlBuilder().View().RowLimit(1).ToString(); 22 | camlQuery = new CamlBuilder().View().RowLimit(1).ToCamlQuery(); 23 | assert.equal(queryText, setXml); 24 | 25 | var date = new Date(); 26 | queryText = new CamlBuilder().View().Query().Where().DateTimeField("Modified").EqualTo(date).ToString(); 27 | camlQuery = new CamlBuilder().View().Query().Where().DateTimeField("Modified").EqualTo(date).ToCamlQuery(); 28 | assert.equal(queryText, setXml); 29 | 30 | queryText = new CamlBuilder().Where().IntegerField("ID").In([1, 2, 3]).ToString(); 31 | camlQuery = new CamlBuilder().Where().IntegerField("ID").In([1, 2, 3]).ToCamlQuery(); 32 | assert.equal("" + queryText + "", setXml); 33 | }); 34 | 35 | test("FinalizeTwice", () => { 36 | assert.throws(() => { 37 | var camlBuilder1 = new CamlBuilder() 38 | .View(["ID", "Created"]) 39 | .RowLimit(20, true) 40 | .Scope(CamlBuilder.ViewScope.RecursiveAll).Query().Where(); 41 | camlBuilder1.TextField("Title").BeginsWith("A").ToString(); 42 | camlBuilder1.TextField("Title").BeginsWith("B").ToString(); 43 | }, /Please create a new CamlBuilder object for every query/); 44 | }); 45 | 46 | test("ToStringTwice", () => { 47 | const builder = new CamlBuilder().View().Query().Where() 48 | .DateTimeField("Modified").GreaterThanOrEqualTo(new Date(2021,1,1).toISOString()) 49 | const query1 = builder.ToString(); 50 | const query2 = builder.ToString(); 51 | 52 | assert.equal( 53 | vkbeautify.xml(query1), 54 | vkbeautify.xml( 55 | ` 56 | 57 | 58 | 59 | 60 | 2021-01-31T22:00:00.000Z 61 | 62 | 63 | 64 | `) 65 | ); 66 | assert.equal(vkbeautify.xml(query1), vkbeautify.xml(query2)); 67 | }); 68 | 69 | test.run(); 70 | -------------------------------------------------------------------------------- /tests/joins.js: -------------------------------------------------------------------------------- 1 | /// @ts-check 2 | 3 | var assert = require("uvu/assert"); 4 | var test = require("uvu").test; 5 | var CamlBuilder = require("../dist/camljs"); 6 | var vkbeautify = require("./vkbeautify"); 7 | 8 | test("Joins", () => { 9 | var query = new CamlBuilder() 10 | .View(["Title", "Country", "Population"]) 11 | .LeftJoin("Country", "Country").Select("y4r6", "Population") 12 | .Query() 13 | .Where() 14 | .NumberField("Population").LessThan(10) 15 | .ToString(); 16 | 17 | 18 | assert.equal( 19 | vkbeautify.xml(query), 20 | vkbeautify.xml( 21 | '\ 22 | \ 23 | \ 24 | \ 25 | \ 26 | \ 27 | \ 28 | \ 29 | \ 30 | \ 31 | \ 32 | \ 33 | \ 34 | \ 35 | \ 36 | \ 37 | \ 38 | \ 39 | \ 40 | \ 41 | \ 42 | 10\ 43 | \ 44 | \ 45 | \ 46 | '), 47 | ); 48 | 49 | }); 50 | 51 | test("NestedJoins", () => { 52 | var query = new CamlBuilder() 53 | .View(["Title", "CustomerCity"]) 54 | .LeftJoin("CustomerName", "customers") 55 | .LeftJoin("CityName", "customerCities", "customers") 56 | .Select("Title", "CustomerCity") 57 | .Query() 58 | .ToString(); 59 | 60 | assert.equal( 61 | vkbeautify.xml(query), 62 | vkbeautify.xml( 63 | '\ 64 | \ 65 | \ 66 | \ 67 | \ 68 | \ 69 | \ 70 | \ 71 | \ 72 | \ 73 | \ 74 | \ 75 | \ 76 | \ 77 | \ 78 | \ 79 | \ 80 | \ 81 | \ 82 | \ 83 | \ 84 | \ 85 | \ 86 | ') 87 | ); 88 | 89 | var query = new CamlBuilder() 90 | .View(["Title", "CustomerName", "CustomerCity"]) 91 | .LeftJoin("CustomerName", "customers") 92 | .Select("Title", "CustomerName") 93 | .LeftJoin("CityName", "customerCities", "customers") 94 | .Select("Title", "CustomerCity") 95 | .Query() 96 | .ToString(); 97 | 98 | assert.equal( 99 | vkbeautify.xml(query), 100 | vkbeautify.xml( 101 | '\ 102 | \ 103 | \ 104 | \ 105 | \ 106 | \ 107 | \ 108 | \ 109 | \ 110 | \ 111 | \ 112 | \ 113 | \ 114 | \ 115 | \ 116 | \ 117 | \ 118 | \ 119 | \ 120 | \ 121 | \ 122 | \ 123 | \ 124 | \ 125 | \ 126 | ') 127 | ); 128 | 129 | }); 130 | 131 | test.run(); 132 | -------------------------------------------------------------------------------- /tests/membership.js: -------------------------------------------------------------------------------- 1 | /// @ts-check 2 | 3 | var assert = require("uvu/assert"); 4 | var test = require("uvu").test; 5 | var CamlBuilder = require("../dist/camljs"); 6 | var vkbeautify = require("./vkbeautify"); 7 | 8 | test("Membership", () => { 9 | 10 | var caml = new CamlBuilder().Where() 11 | .UserField("AssignedTo").EqualToCurrentUser() 12 | .Or() 13 | .UserField("AssignedTo").IsInCurrentUserGroups() 14 | .GroupBy("Category") 15 | .OrderBy("Priority").ThenBy("Title") 16 | .ToString(); 17 | 18 | assert.equal( 19 | vkbeautify.xml(caml), 20 | vkbeautify.xml( 21 | '\ 22 | \ 23 | \ 24 | \ 25 | \ 26 | \ 27 | \ 28 | \ 29 | \ 30 | \ 31 | \ 32 | ') 33 | ); 34 | 35 | 36 | }); 37 | 38 | test("GroupMembership", () => { 39 | 40 | var caml = new CamlBuilder().Where() 41 | .UserField("AssignedTo").IsInSPGroup(10) 42 | .ToString(); 43 | 44 | assert.equal( 45 | vkbeautify.xml(caml), 46 | vkbeautify.xml( 47 | ` 48 | 49 | 50 | 51 | ` 52 | ) 53 | ); 54 | 55 | 56 | }); 57 | 58 | 59 | test.run(); 60 | -------------------------------------------------------------------------------- /tests/modify.js: -------------------------------------------------------------------------------- 1 | /// @ts-check 2 | 3 | var assert = require("uvu/assert"); 4 | var test = require("uvu").test; 5 | var CamlBuilder = require("../dist/camljs"); 6 | var vkbeautify = require("./vkbeautify"); 7 | 8 | test("ReplaceWhere", () => { 9 | var rawQuery = '\ 10 | \ 11 | \ 12 | \ 13 | \ 14 | \ 15 | \ 16 | \ 17 | '; 18 | 19 | var query = CamlBuilder.FromXml(rawQuery).ReplaceWhere().TextField("Title").IsNotNull().ToString(); 20 | 21 | assert.equal( 22 | vkbeautify.xml(query), 23 | vkbeautify.xml('\ 24 | \ 25 | \ 26 | \ 27 | \ 28 | \ 29 | \ 30 | \ 31 | ') 32 | ); 33 | 34 | }); 35 | 36 | test("AppendToWhere", () => { 37 | var rawQuery = '\ 38 | \ 39 | \ 40 | \ 41 | \ 42 | \ 43 | \ 44 | \ 45 | '; 46 | 47 | var query = CamlBuilder.FromXml(rawQuery).ModifyWhere().AppendAnd().TextField("Title").IsNotNull().ToString(); 48 | 49 | assert.equal( 50 | vkbeautify.xml(query), 51 | vkbeautify.xml('\ 52 | \ 53 | \ 54 | \ 55 | \ 56 | \ 57 | \ 58 | \ 59 | \ 60 | \ 61 | \ 62 | \ 63 | \ 64 | ') 65 | ); 66 | 67 | }); 68 | 69 | test("AppendToWhereWithOrderBy", () => { 70 | var rawQuery = '\ 71 | \ 72 | \ 73 | \ 74 | \ 75 | 10\ 76 | \ 77 | \ 78 | \ 79 | \ 80 | \ 81 | \ 82 | '; 83 | 84 | var query = CamlBuilder.FromXml(rawQuery).ModifyWhere().AppendOr().TextField("Title").Contains("Summer").ToString(); 85 | 86 | assert.equal( 87 | vkbeautify.xml(query), 88 | vkbeautify.xml('\ 89 | \ 90 | \ 91 | \ 92 | \ 93 | \ 94 | \ 95 | \ 96 | \ 97 | 10\ 98 | \ 99 | \ 100 | \ 101 | Summer\ 102 | \ 103 | \ 104 | \ 105 | \ 106 | ') 107 | ); 108 | 109 | }); 110 | 111 | test.run(); 112 | -------------------------------------------------------------------------------- /tests/vkbeautify.js: -------------------------------------------------------------------------------- 1 | /** 2 | * vkBeautify - javascript plugin to pretty-print or minify text in XML, JSON, CSS and SQL formats. 3 | * 4 | * Version - 0.99.00.beta 5 | * Copyright (c) 2012 Vadim Kiryukhin 6 | * vkiryukhin @ gmail.com 7 | * http://www.eslinstructor.net/vkbeautify/ 8 | * 9 | * Dual licensed under the MIT and GPL licenses: 10 | * http://www.opensource.org/licenses/mit-license.php 11 | * http://www.gnu.org/licenses/gpl.html 12 | * 13 | */ 14 | 15 | function createShiftArr(step) { 16 | 17 | var space = ' '; 18 | 19 | if (isNaN(parseInt(step))) { // argument is string 20 | space = step; 21 | } else { // argument is integer 22 | switch (step) { 23 | case 1: space = ' '; break; 24 | case 2: space = ' '; break; 25 | case 3: space = ' '; break; 26 | case 4: space = ' '; break; 27 | case 5: space = ' '; break; 28 | case 6: space = ' '; break; 29 | case 7: space = ' '; break; 30 | case 8: space = ' '; break; 31 | case 9: space = ' '; break; 32 | case 10: space = ' '; break; 33 | case 11: space = ' '; break; 34 | case 12: space = ' '; break; 35 | } 36 | } 37 | 38 | var shift = ['\n']; // array of shifts 39 | for (ix = 0; ix < 100; ix++) { 40 | shift.push(shift[ix] + space); 41 | } 42 | return shift; 43 | } 44 | 45 | function vkbeautify() { 46 | this.step = ' '; // 4 spaces 47 | this.shift = createShiftArr(this.step); 48 | }; 49 | 50 | vkbeautify.prototype.xml = function (text, step) { 51 | 52 | var ar = text.replace(/>\s{0,}<") 53 | .replace(/