From b60eb07eefc7ef7c96a79c3ccab049110e46c478 Mon Sep 17 00:00:00 2001 From: Niels Steenbeek Date: Wed, 28 Oct 2020 16:03:12 +0100 Subject: [PATCH 1/8] Tenant support --- bin/main.js | 2 +- bin/root/tools/deploy.js | 2 +- bin/root/tools/resx.js | 2 +- bin/root/tools/setFormCustomizable.js | 2 +- package.json | 2 +- src/root/tools/AdalRouter.ts | 4 ++++ src/root/tools/CrmJson.ts | 1 + 7 files changed, 10 insertions(+), 5 deletions(-) diff --git a/bin/main.js b/bin/main.js index b596cbe..8318219 100644 --- a/bin/main.js +++ b/bin/main.js @@ -1 +1 @@ -/*! HSO D365 CLI 1.8.0 | (c) HSO Innovation */!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=23)}([function(e,t){e.exports=require("fs")},function(e,t){e.exports=require("shelljs")},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0?"?"+c.join("&"):""},e.generateSelect=function(e){return void 0===e&&(e=[]),e.length>0?"$select="+e.join(","):null},e.generateFilter=function(t){void 0===t&&(t=[]);var n=[];if(t.length>0)for(var r=0,o=t;r0?"$filter="+n.join(" and "):null},e.parseFilter=function(e){for(var t=e.type,n=void 0===t?"and":t,r=[],o=0,i=e.conditions;o0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]\n test\n \n \n diff --git a/src/root/tools/NodeApi/NodeApi.ts b/src/root/tools/NodeApi/NodeApi.ts index 766d9dc..10216b8 100644 --- a/src/root/tools/NodeApi/NodeApi.ts +++ b/src/root/tools/NodeApi/NodeApi.ts @@ -1,5 +1,4 @@ import {Filter, MultipleSystemQueryOptions, SystemQueryOptions} from '../../../../bin/root/src/WebApi/WebApi'; -import {Model} from '../../../../bin/root/src/WebApi/Model'; import * as fs from 'fs'; import * as https from 'https'; import { IncomingMessage } from 'http'; diff --git a/src/root/tools/Solution/Solution.model.ts b/src/root/tools/Solution/Solution.model.ts index e2f2020..af06500 100644 --- a/src/root/tools/Solution/Solution.model.ts +++ b/src/root/tools/Solution/Solution.model.ts @@ -1,4 +1,3 @@ -import {Model} from '../../../../bin/root/src/WebApi/Model'; export interface SolutionModel extends Model { solutionid?: string; diff --git a/src/root/tools/SolutionComponent/SolutionComponent.model.ts b/src/root/tools/SolutionComponent/SolutionComponent.model.ts index de9a377..5fadbb0 100644 --- a/src/root/tools/SolutionComponent/SolutionComponent.model.ts +++ b/src/root/tools/SolutionComponent/SolutionComponent.model.ts @@ -1,4 +1,3 @@ -import {Model} from '../../../../bin/root/src/WebApi/Model'; export interface SolutionComponentModel extends Model { solutioncomponentid?: string; diff --git a/src/root/tools/SystemForm/SystemForm.model.ts b/src/root/tools/SystemForm/SystemForm.model.ts index b9d3e1e..0c6f692 100644 --- a/src/root/tools/SystemForm/SystemForm.model.ts +++ b/src/root/tools/SystemForm/SystemForm.model.ts @@ -1,4 +1,3 @@ -import {Model} from '../../../../bin/root/src/WebApi/Model'; export interface SystemFormModel extends Model { formid?: string; diff --git a/src/root/tools/Webresource/Webresource.model.ts b/src/root/tools/Webresource/Webresource.model.ts index b4f39b6..5581ec9 100644 --- a/src/root/tools/Webresource/Webresource.model.ts +++ b/src/root/tools/Webresource/Webresource.model.ts @@ -1,4 +1,3 @@ -import {Model} from '../../../../bin/root/src/WebApi/Model'; type ComponentType = 'WebResource'; diff --git a/src/tsconfig.json b/tsconfig.json similarity index 84% rename from src/tsconfig.json rename to tsconfig.json index ab93360..7f4c079 100644 --- a/src/tsconfig.json +++ b/tsconfig.json @@ -13,7 +13,8 @@ "dom" ] }, - "exclude": [ - "node_modules" + "include": [ + "src", + "bin/root/src/WebApi" ] } From 0318d91b0ceb880f221289b0a988ed509dcf6edb Mon Sep 17 00:00:00 2001 From: Niels Steenbeek Date: Fri, 6 Nov 2020 09:28:26 +0100 Subject: [PATCH 5/8] Remove 'old' update statements --- src/Update.ts | 202 +++++++------------------------------------------- 1 file changed, 26 insertions(+), 176 deletions(-) diff --git a/src/Update.ts b/src/Update.ts index 0d38aec..87e0470 100644 --- a/src/Update.ts +++ b/src/Update.ts @@ -18,15 +18,12 @@ export class Update { private static async update(): Promise { console.log(`Updating D365 Project...`); - Update.moveDeploy(); const variables = await Variables.get(); Update.updateProjectRootFolder(); - Update.updateDeploy(variables); Update.updateSrcFolder(); - Update.updatePackageJson(variables); + // Update.updatePackageJson(variables); Update.updateServiceFiles(); Update.updateModelFiles(); - Update.updateFormFiles(variables); Update.updateEntityFiles(); Update.updateWebpackConfig(variables); console.log(`Updating D365 Project done`); @@ -44,8 +41,6 @@ export class Update { console.log(`Updating postcss.config.js`); shell.cp('-R', `${__dirname}/root/postcss.config.js`, '.'); - shell.exec('git add postcss.config.js'); - } private static updateSrcFolder(): void { @@ -54,151 +49,49 @@ export class Update { console.log(`Updating WebApi...`); shell.cp('-R', `${__dirname}/root/src/WebApi`, './src'); - shell.exec('git add src/WebApi/Model.ts'); - shell.exec('git add src/WebApi/Service.ts'); console.log(`Updating Http...`); shell.cp('-R', `${__dirname}/root/src/Http`, './src'); - shell.exec('git add src/Http/Http.ts'); console.log(`Updating util...`); shell.cp('-R', `${__dirname}/root/src/util`, './src'); - shell.exec('git add src/util/Base64.ts'); - shell.exec('git add src/util/FormUtil.ts'); console.log(`Updating Annotation...`); shell.cp('-R', `${__dirname}/root/src/Annotation`, './src'); - shell.exec('git add src/Annotation/Annotation.model.ts'); - shell.exec('git add src/Annotation/Annotation.service.ts'); console.log(`Updating Translation...`); shell.cp('-R', `${__dirname}/root/src/translation`, './src'); - shell.exec('git add src/translation/TranslationI18n.ts'); - - Update.cleanSrcFolder(); - } - - private static cleanSrcFolder(): void { - console.log(`Removing tslint.json...`); - shell.rm('-R', `./src/tslint.json`); - - console.log(`Removing txs...`); - shell.rm('-R', './src/tsx'); } - private static moveDeploy(): void { - console.log(`Moving deploy folder...`); - if (shell.test('-f', 'deploy/deploy.js')) { - if (!shell.test('-d', 'tools')) { - shell.mkdir('tools'); - } - shell.cp('-R','deploy/*', 'tools'); - if (shell.which('git')) { - shell.exec('git rm deploy/deploy.js'); - shell.exec('git rm deploy/crm.json'); - } - } - } - - private static updateDeploy(variables: AllVariables): void { - console.log(`Updating deploy folder...`); - if (!shell.test('-d', 'tools')) { - shell.mkdir('tools'); - } - shell.cp('-R', `${__dirname}/root/tools/*.js`, './tools'); - shell.cp('-R', `${__dirname}/root/tools/*.resx`, './tools'); - shell.exec('git add tools'); - const checkClientSecret = shell.grep(`clientSecret`, './tools/crm.json'), - checkTranslation = shell.grep('translation', './tools/crm.json'), - {publisher, solution, environment, namespace, translationtype} = variables; - if (checkClientSecret.stdout !== '\n' || checkTranslation.stdout === '\n') { - shell.cp('-R', `${__dirname}/root/tools/crm.json`, './tools'); - const crmJsonFile = shell.ls('./tools/crm.json')[0]; - shell.sed('-i', new RegExp('<%= publisher %>', 'ig'), publisher, crmJsonFile); - shell.sed('-i', new RegExp('<%= solution %>', 'ig'), solution, crmJsonFile); - shell.sed('-i', new RegExp('<%= environment %>', 'ig'), environment, crmJsonFile); - shell.sed('-i', new RegExp('<%= namespace %>', 'ig'), namespace, crmJsonFile); - shell.sed('-i', new RegExp('<%= translationtype %>', 'ig'), translationtype || 'i18n', crmJsonFile); - } - } - - private static updatePackageJson(variables: AllVariables): void { - console.log(`Updating package.json...`); - let dlfCoreCheck = shell.grep(`dlf-core`, 'package.json'); - const {projectname, description, publisher, version} = variables; - if (dlfCoreCheck.stdout !== '\n') { - shell.exec('npm install --save dlf-core@latest'); - dlfCoreCheck = shell.grep(`dlf-core`, 'package.json'); - } - shell.cp('-R', `${__dirname}/root/package.json`, '.'); - const packageJsonFile = shell.ls('package.json')[0]; - if (dlfCoreCheck.stdout !== '\n') { - shell.sed('-i', '"dependencies": {', `"dependencies": {\n${dlfCoreCheck.stdout}`, packageJsonFile); - } - shell.sed('-i', new RegExp('<%= projectname %>', 'ig'), projectname, packageJsonFile); - shell.sed('-i', new RegExp('<%= description %>', 'ig'), description, packageJsonFile); - shell.sed('-i', new RegExp('<%= publisher %>', 'ig'), publisher, packageJsonFile); - shell.sed('-i', new RegExp('<%= version %>', 'ig'), version, packageJsonFile); - console.log(`Removing old npm packages. This may take a while...`); - shell.exec('npm prune'); - shell.exec('npm install'); - } + // private static updatePackageJson(variables: AllVariables): void { + // console.log(`Updating package.json...`); + // let dlfCoreCheck = shell.grep(`dlf-core`, 'package.json'); + // const {projectname, description, publisher, version} = variables; + // if (dlfCoreCheck.stdout !== '\n') { + // shell.exec('npm install --save dlf-core@latest'); + // dlfCoreCheck = shell.grep(`dlf-core`, 'package.json'); + // } + // shell.cp('-R', `${__dirname}/root/package.json`, '.'); + // const packageJsonFile = shell.ls('package.json')[0]; + // if (dlfCoreCheck.stdout !== '\n') { + // shell.sed('-i', '"dependencies": {', `"dependencies": {\n${dlfCoreCheck.stdout}`, packageJsonFile); + // } + // shell.sed('-i', new RegExp('<%= projectname %>', 'ig'), projectname, packageJsonFile); + // shell.sed('-i', new RegExp('<%= description %>', 'ig'), description, packageJsonFile); + // shell.sed('-i', new RegExp('<%= publisher %>', 'ig'), publisher, packageJsonFile); + // shell.sed('-i', new RegExp('<%= version %>', 'ig'), version, packageJsonFile); + // console.log(`Removing old npm packages. This may take a while...`); + // shell.exec('npm prune'); + // shell.exec('npm install'); + // } private static updateServiceFiles(): void { - console.log(`Updating Service files`); + console.log(`Updating Service files...`); shell.ls(`src/**/*.service.ts*`).forEach(function (filepath) { - Update.updateServiceFileCount(filepath); - Update.updateServiceFileCloneValidation(filepath); Update.updateServiceModel(filepath); }); } - private static serviceFileSnippetCount = `public static async count(filters?: Filter[]): Promise { - return WebApi.count(EntityService.logicalName, filters); - }`; - - private static updateServiceFileCount(filepath: string): void { - console.log(`Updating Service files Count code`); - const countCheck = shell.grep(`public static async count`, filepath); - if (countCheck.stdout === '\n') { - const split = filepath.split('/'), - entityname = split[1], - file = shell.ls(filepath)[0]; - shell.sed('-i', `import {MultipleSystemQueryOptions, SystemQueryOptions, WebApi} from '../WebApi/WebApi';`, - `import {Filter, MultipleSystemQueryOptions, SystemQueryOptions, WebApi} from '../WebApi/WebApi';`, file); - shell.sed('-i', `export class ${entityname}Service {`, - `export class ${entityname}Service {\n ` + Update.serviceFileSnippetCount - .replace(/EntityService/g, `${entityname}Service`) + '\n', file); - console.log(`Modified ${filepath}`); - } - } - - private static serviceFileSnippetCloneValidation = `public static async retrieveClone(id: string): Promise { - const origRecord = await Xrm.WebApi.retrieveRecord(EntityService.logicalName, id); - return Model.parseCreateModel(EntityService.logicalName, origRecord); - } - - public static async validateRecord(entityModel: EntityModel): Promise { - return Model.validateRecord(EntityService.logicalName, entityModel); - }`; - - private static updateServiceFileCloneValidation(filepath: string): void { - console.log(`Updating Service files Clone and Validation code`); - const cloneCheck = shell.grep(`retrieveClone`, filepath); - if (cloneCheck.stdout === '\n') { - const split = filepath.split('/'), - entityname = split[1], - entitynameCamelCase = entityname.charAt(0).toLowerCase() + entityname.slice(1), - file = shell.ls(filepath)[0]; - shell.sed('-i', `export class ${entityname}Service {`, - `export class ${entityname}Service {\n ` + Update.serviceFileSnippetCloneValidation - .replace(/EntityService/g, `${entityname}Service`) - .replace(/EntityModel/g, `${entityname}Model`) - .replace(/entityModel/g, `${entitynameCamelCase}Model`) + '\n', file); - console.log(`Modified ${filepath}`); - } - } - private static updateServiceModel(filepath: string): void { const file = shell.ls(filepath)[0]; const serviceCheck = shell.grep(`Model.`, filepath); @@ -209,20 +102,9 @@ export class Update { shell.sed('-i', `import {Model} from '../WebApi/Model';`, ``, file); } - // eslint-disable-next-line max-lines-per-function private static updateModelFiles(): void { - console.log(`Updating Model files`); - // eslint-disable-next-line max-lines-per-function + console.log(`Updating Model files...`); shell.ls(`src/**/*.model.ts*`).forEach(function (filepath) { - const extendsCheck = shell.grep(`extends Model`, filepath); - if (extendsCheck.stdout === '\n') { - const split = filepath.split('/'), - entityname = split[1], - file = shell.ls(filepath)[0]; - // shell.sed('-i', `export`, `import {Model} from '../WebApi/Model';\nexport`, file); - shell.sed('-i', `interface ${entityname}Model {`, `interface ${entityname}Model extends Model {`, file); - console.log(`Modified ${filepath}`); - } const filedata = String(fs.readFileSync(filepath)); if (filedata.includes('enum')) { const split = filepath.split('/'), @@ -246,42 +128,10 @@ export class Update { }); } - private static getTranslationInitRegex(variables: AllVariables): RegExp { - const {publisher, namespace} = variables; - return new RegExp(`await Translation\\.init\\({\\s*relativePath:\\s'${publisher}_/${namespace}/locales'\\s*}\\);\\s*`, 'gm'); - // return /await Translation\.init\({\s*relativePath:\s'hds_\/ces\/locales'\s*}\);\s*/gm; - } - private static updateFormFiles(variables: AllVariables): void { - console.log('Updating Entity files'); - const filepaths = shell.ls(`src/**/*.form.ts`); - for (const filepath of filepaths) { - const translationCheck = shell.grep(`Translation.init`, filepath); - if (translationCheck.stdout !== '\n') { - const filedata = String(fs.readFileSync(filepath)); - shell.ShellString(filedata.replace(Update.getTranslationInitRegex(variables), '')).to(filepath); - console.log(`Modified ${filepath}`); - } - } - } - private static updateEntityFiles(): void { - console.log('Updating Entity files'); + console.log('Updating Entity files...'); shell.ls(`src/**/*.ts*`).forEach(function (filepath) { - const split = filepath.split('/'), - entityname = split[1], - file = shell.ls(filepath)[0]; - if (`${entityname}.ts` === split[2]) { - const check = shell.grep(`export namespace`, filepath); - if (check.stdout === '\n') { - shell.sed('-i', `export namespace Form`, `export const Form =`, file); - shell.sed('-i', `export namespace Ribbon`, `export const Ribbon =`, file); - // eslint-disable-next-line max-len - shell.sed('-i', `export function onLoad(executionContext: Xrm.Events.EventContext) {`, `onLoad: (executionContext: Xrm.Events.EventContext): void => {`, file); - shell.sed('-i', `\\(formContext: Xrm.FormContext\\) {`, `: (formContext: Xrm.FormContext): void => {`, file); - // shell.sed('-i', `export function `, ``, file); too much - console.log(`Modified ${split[1]}.ts ${split[2]}`); - } - } + const file = shell.ls(filepath)[0]; const modelCheck = shell.grep('.model', filepath); if (modelCheck.stdout !== '\n') { shell.sed('-i', new RegExp(`// import.*\\.model';`, 'ig'), '', file); From 0c2fb8450b24630db8c579ef7f315b327e5a8785 Mon Sep 17 00:00:00 2001 From: Niels Steenbeek Date: Fri, 6 Nov 2020 10:04:32 +0100 Subject: [PATCH 6/8] Annotation update --- bin/root/src/Annotation/Annotation.model.ts | 4 ++-- bin/root/src/Annotation/Annotation.service.ts | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/bin/root/src/Annotation/Annotation.model.ts b/bin/root/src/Annotation/Annotation.model.ts index 2e03728..4cdbcd2 100644 --- a/bin/root/src/Annotation/Annotation.model.ts +++ b/bin/root/src/Annotation/Annotation.model.ts @@ -1,5 +1,5 @@ -import {Model} from '../WebApi/Model'; -export interface AnnotationModel extends Model { + +interface AnnotationModel extends Model { annotationid?: string; documentbody?: string; filename?: string; diff --git a/bin/root/src/Annotation/Annotation.service.ts b/bin/root/src/Annotation/Annotation.service.ts index eee122e..79b1088 100644 --- a/bin/root/src/Annotation/Annotation.service.ts +++ b/bin/root/src/Annotation/Annotation.service.ts @@ -1,7 +1,6 @@ -import {Filter, MultipleSystemQueryOptions, SystemQueryOptions, WebApi} from '../WebApi/WebApi'; -import {AnnotationModel} from './Annotation.model'; +import {WebApi} from '../WebApi/WebApi'; import {Base64} from '../util/Base64'; -import {Model, ModelValidation} from '../WebApi/Model'; +import {Service} from '../WebApi/Service'; export class AnnotationService { private static logicalName = 'annotation'; @@ -82,10 +81,10 @@ export class AnnotationService { public static async retrieveClone(id: string): Promise { const origRecord = await Xrm.WebApi.retrieveRecord(AnnotationService.logicalName, id); - return Model.parseCreateModel(AnnotationService.logicalName, origRecord); + return Service.parseCreateModel(AnnotationService.logicalName, origRecord); } public static async validateRecord(annotationModel: AnnotationModel): Promise { - return Model.validateRecord(AnnotationService.logicalName, annotationModel); + return Service.validateRecord(AnnotationService.logicalName, annotationModel); } } From 60c251ea123145f01c556404bbf0025cfad19186 Mon Sep 17 00:00:00 2001 From: Niels Steenbeek Date: Fri, 6 Nov 2020 10:12:26 +0100 Subject: [PATCH 7/8] Http interfaces without export/import --- bin/main.js | 2 +- bin/root/src/Http/Http.ts | 12 ----- bin/root/src/Http/HttpHeaders.ts | 12 +++++ bin/root/src/WebApi/SystemQueryOptions.ts | 48 +++++++++++++++++++ bin/root/src/WebApi/WebApi.ts | 48 +------------------ src/Update.ts | 48 ++++++++++--------- src/root/tools/NodeApi/NodeApi.ts | 1 - src/root/tools/Solution/Solution.service.ts | 1 - .../SolutionComponent.service.ts | 1 - .../tools/SystemForm/SystemForm.service.ts | 1 - .../tools/Webresource/Webresource.service.ts | 1 - tsconfig.json | 3 +- 12 files changed, 90 insertions(+), 88 deletions(-) create mode 100644 bin/root/src/Http/HttpHeaders.ts create mode 100644 bin/root/src/WebApi/SystemQueryOptions.ts diff --git a/bin/main.js b/bin/main.js index bc48552..208334f 100644 --- a/bin/main.js +++ b/bin/main.js @@ -1 +1 @@ -/*! HSO D365 CLI 1.8.3 | (c) HSO Innovation */!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=23)}([function(e,t){e.exports=require("fs")},function(e,t){e.exports=require("shelljs")},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0?"?"+c.join("&"):""},e.generateSelect=function(e){return void 0===e&&(e=[]),e.length>0?"$select="+e.join(","):null},e.generateFilter=function(t){void 0===t&&(t=[]);var n=[];if(t.length>0)for(var r=0,o=t;r0?"$filter="+n.join(" and "):null},e.parseFilter=function(e){for(var t=e.type,n=void 0===t?"and":t,r=[],o=0,i=e.conditions;o0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]\n Login\n \n \n