From 924cdd3d4b2f89184f66b33ba7371ce33aeeced6 Mon Sep 17 00:00:00 2001 From: Kalarumeth <70245579+Kalarumeth@users.noreply.github.com> Date: Fri, 2 Sep 2022 18:50:27 +0200 Subject: [PATCH] Major Update Defined structure of project --- console_spo_utils/Constants/Fields.cs | 51 + console_spo_utils/Constants/Folders.cs | 60 + console_spo_utils/Enums/FieldType.cs | 8 + .../FakeProjectSettingsRepository.cs | 16 + .../Repositories/FakeSubProjectRepository.cs | 17 + .../IProjectSettingsRepository.cs | 7 + .../Repositories/ISubProjectRepository.cs | 6 + .../Interfaces/Services/IOneNoteService.cs | 10 + .../Services/IProjectDocLibraryService.cs | 8 + .../Services/IProjectQuickMenuService.cs | 8 + .../Services/IProjectYearService.cs | 10 + .../Services/IQuotationBuildService.cs | 6 + .../Services/IQuotationDocLibraryService.cs | 8 + .../Services/IQuotationDocSetService.cs | 8 + .../Interfaces/Services/IRightsService.cs | 8 + .../ISharePointAuthenticationManager.cs | 10 + .../Services/ISharePointCustomOperation.cs | 15 + .../Services/ISharePointStructureBuilder.cs | 7 + .../Interfaces/Services/ISiteOptions.cs | 24 + .../Interfaces/Services/ISiteService.cs | 9 + .../Services/ISubProjectBuilderService.cs | 8 + .../Interfaces/Services/ISubSiteService.cs | 9 + .../Interfaces/Services/ITenantService.cs | 10 + console_spo_utils/Model/ParentProj.cs | 11 + console_spo_utils/Model/SubProj.cs | 15 + console_spo_utils/Model/TokenWaitInfo.cs | 7 + console_spo_utils/Model/XmlFieldsModel.cs | 60 + console_spo_utils/Program.cs | 1371 +---------------- .../Repositories/SubProjectRepository.cs | 11 + .../Services/AutenticationManager.cs | 209 +++ console_spo_utils/Services/OfferService.cs | 234 +++ console_spo_utils/Services/OneNoteService.cs | 91 ++ .../Services/ProjectDocLibraryService.cs | 86 ++ .../Services/ProjectQuickMenuService.cs | 61 + .../Services/ProjectYearService.cs | 122 ++ .../Services/QuotationBuildService.cs | 57 + .../Services/QuotationDocLibraryService.cs | 115 ++ .../Services/QuotationDocSetService.cs | 116 ++ console_spo_utils/Services/RightsService.cs | 118 ++ .../Services/SharePointCustomOperation.cs | 160 ++ .../SharePointStructureBuilderService.cs | 63 + console_spo_utils/Services/SiteOptions.cs | 67 + console_spo_utils/Services/SiteService.cs | 165 ++ .../Services/SubProjectBuilderService.cs | 126 ++ console_spo_utils/Services/SubSiteService.cs | 114 ++ console_spo_utils/Services/TenantService.cs | 101 ++ console_spo_utils/Workers/MainWorker.cs | 65 + .../Debug/net6.0/console_spo_utils.deps.json | 478 ++++++ console_spo_utils/console_spo_utils.csproj | 11 +- ...sole_spo_utils.csproj.FileListAbsolute.txt | 35 + ...console_spo_utils.csproj.nuget.dgspec.json | 12 + .../console_spo_utils.csproj.nuget.g.props | 1 + .../console_spo_utils.csproj.nuget.g.targets | 1 + console_spo_utils/obj/project.assets.json | 957 ++++++++++++ 54 files changed, 4033 insertions(+), 1330 deletions(-) create mode 100644 console_spo_utils/Constants/Fields.cs create mode 100644 console_spo_utils/Constants/Folders.cs create mode 100644 console_spo_utils/Enums/FieldType.cs create mode 100644 console_spo_utils/Fakes/Repositories/FakeProjectSettingsRepository.cs create mode 100644 console_spo_utils/Fakes/Repositories/FakeSubProjectRepository.cs create mode 100644 console_spo_utils/Interfaces/Repositories/IProjectSettingsRepository.cs create mode 100644 console_spo_utils/Interfaces/Repositories/ISubProjectRepository.cs create mode 100644 console_spo_utils/Interfaces/Services/IOneNoteService.cs create mode 100644 console_spo_utils/Interfaces/Services/IProjectDocLibraryService.cs create mode 100644 console_spo_utils/Interfaces/Services/IProjectQuickMenuService.cs create mode 100644 console_spo_utils/Interfaces/Services/IProjectYearService.cs create mode 100644 console_spo_utils/Interfaces/Services/IQuotationBuildService.cs create mode 100644 console_spo_utils/Interfaces/Services/IQuotationDocLibraryService.cs create mode 100644 console_spo_utils/Interfaces/Services/IQuotationDocSetService.cs create mode 100644 console_spo_utils/Interfaces/Services/IRightsService.cs create mode 100644 console_spo_utils/Interfaces/Services/ISharePointAuthenticationManager.cs create mode 100644 console_spo_utils/Interfaces/Services/ISharePointCustomOperation.cs create mode 100644 console_spo_utils/Interfaces/Services/ISharePointStructureBuilder.cs create mode 100644 console_spo_utils/Interfaces/Services/ISiteOptions.cs create mode 100644 console_spo_utils/Interfaces/Services/ISiteService.cs create mode 100644 console_spo_utils/Interfaces/Services/ISubProjectBuilderService.cs create mode 100644 console_spo_utils/Interfaces/Services/ISubSiteService.cs create mode 100644 console_spo_utils/Interfaces/Services/ITenantService.cs create mode 100644 console_spo_utils/Model/ParentProj.cs create mode 100644 console_spo_utils/Model/SubProj.cs create mode 100644 console_spo_utils/Model/TokenWaitInfo.cs create mode 100644 console_spo_utils/Model/XmlFieldsModel.cs create mode 100644 console_spo_utils/Repositories/SubProjectRepository.cs create mode 100644 console_spo_utils/Services/AutenticationManager.cs create mode 100644 console_spo_utils/Services/OfferService.cs create mode 100644 console_spo_utils/Services/OneNoteService.cs create mode 100644 console_spo_utils/Services/ProjectDocLibraryService.cs create mode 100644 console_spo_utils/Services/ProjectQuickMenuService.cs create mode 100644 console_spo_utils/Services/ProjectYearService.cs create mode 100644 console_spo_utils/Services/QuotationBuildService.cs create mode 100644 console_spo_utils/Services/QuotationDocLibraryService.cs create mode 100644 console_spo_utils/Services/QuotationDocSetService.cs create mode 100644 console_spo_utils/Services/RightsService.cs create mode 100644 console_spo_utils/Services/SharePointCustomOperation.cs create mode 100644 console_spo_utils/Services/SharePointStructureBuilderService.cs create mode 100644 console_spo_utils/Services/SiteOptions.cs create mode 100644 console_spo_utils/Services/SiteService.cs create mode 100644 console_spo_utils/Services/SubProjectBuilderService.cs create mode 100644 console_spo_utils/Services/SubSiteService.cs create mode 100644 console_spo_utils/Services/TenantService.cs create mode 100644 console_spo_utils/Workers/MainWorker.cs diff --git a/console_spo_utils/Constants/Fields.cs b/console_spo_utils/Constants/Fields.cs new file mode 100644 index 0000000..6dc79a1 --- /dev/null +++ b/console_spo_utils/Constants/Fields.cs @@ -0,0 +1,51 @@ +namespace console_spo_utils.Constants; + +public static class Fields +{ + public static string[] SubProject + { + get + { + return new string[] { "Item", "Codice Articolo", "Descrizione Articolo", "Matricola Macchina" }; + } + } + + public static string[] SiteFields + { + get + { + return new[] { "ID Progetto", "Cliente", "Causale" }; + } + } + + public static Dictionary ProjectCustomFields + { + get + { + return new Dictionary() + { + { "PAL_ID_Project", new string[] { "URL", "ID Progetto", "PAL Field", "FALSE", "TRUE", "TRUE", "TRUE", "TRUE", "TRUE", string.Empty } }, + { "PAL_DlvReason", new string[] { "Choice", "Causale", "PAL Field", "FALSE", "TRUE", "TRUE", "TRUE", "TRUE", "TRUE", "01 VENDITA MACCHINE / IMPIANTI02 VENDITA RICAMBI04 VENDITA SERVIZI FUORI COMMESSA08 VENDITA RIPARAZIONI09 ENGINEERING11 VENDITA E LAVORAZ.CONTO TERZI55 PREVENDITENC NON CONFORMITÁ" } }, + { "PAL_Customer", new string[] { "Text", "Cliente", "PAL Field", "FALSE", "TRUE", "TRUE", "TRUE", "TRUE", "TRUE", string.Empty } }, + { "PAL_Item", new string[] { "Text", "Item", "PAL Field", "FALSE", "FALSE", "TRUE", "TRUE", "TRUE", "TRUE", string.Empty } }, + { "PAL_ItemCode", new string[] { "Text", "Codice Articolo", "PAL Field", "FALSE", "FALSE", "TRUE", "TRUE", "TRUE", "TRUE", string.Empty } }, + { "PAL_ItemDescription", new string[] { "Text", "Descrizione Articolo", "PAL Field", "FALSE", "FALSE", "TRUE", "TRUE", "TRUE", "TRUE", string.Empty } }, + { "PAL_SerialNumber", new string[] { "Text", "Matricola Macchina", "PAL Field", "FALSE", "FALSE", "TRUE", "TRUE", "TRUE", "TRUE", string.Empty } } + }; + } + } + + public static Dictionary QuotationCustomFields + { + get + { + return new Dictionary() + { + { "PAL_Quotation_Reason", new string[] { "Choice", "Causale", "PAL Field", "FALSE", "TRUE", "TRUE", "TRUE", "TRUE", "TRUE", $"01 VENDITA MACCHINE / IMPIANTI02 VENDITA RICAMBI04 VENDITA SERVIZI FUORI COMMESSA08 VENDITA RIPARAZIONI09 ENGINEERING11 VENDITA E LAVORAZ.CONTO TERZI55 PREVENDITENC NON CONFORMITÁ" } }, + { "PAL_ID_Quotation", new string[] { "Text", "ID Offerta", "PAL Field", "FALSE", "FALSE", "TRUE", "TRUE", "TRUE", "TRUE", string.Empty } }, + { "PAL_Quotation_Name", new string[] { "Text", "Fornitore", "PAL Field", "FALSE", "FALSE", "TRUE", "TRUE", "TRUE", "TRUE", string.Empty } }, + { "PAL_Authors", new string[] { "Text", "Autore", "PAL Field", "FALSE", "FALSE", "TRUE", "TRUE", "TRUE", "TRUE", string.Empty } } + }; + } + } +} \ No newline at end of file diff --git a/console_spo_utils/Constants/Folders.cs b/console_spo_utils/Constants/Folders.cs new file mode 100644 index 0000000..36269eb --- /dev/null +++ b/console_spo_utils/Constants/Folders.cs @@ -0,0 +1,60 @@ +using System.Collections; +using Microsoft.SharePoint.Client; + +namespace console_spo_utils.Constants; + +public static class Folders +{ + public static Dictionary GetProjectFolders(string projName) + { + var folderName = new Dictionary + { + { "01_Costificazioni", $"Commerciale {projName}" }, + { "02_Conferma_Ordine", $"Commerciale {projName}" }, + { "03_Amministrazione", $"Commerciale {projName}" }, + { "05_Documenti_di_Spedizione", $"Documenti {projName}" }, + { "07_Service", $"Documenti {projName}" }, + { "08_Specifiche_Tecniche_E_Meeting", $"Documenti {projName}" }, + { "10_Fornitori", $"Documenti {projName}" }, + { "11_Documenti_Tecnici", $"Documenti {projName}" } + }; + return folderName; + } + public static Dictionary GetProjectQuickMenu(string projName, string subSiteUrl) + { + var itemQuickMenu = new Dictionary + { + { $"Commerciale {projName}", $"{subSiteUrl}/Commerciale%20{projName}" }, + { $"Documenti {projName}", $"{subSiteUrl}/Documenti%20{projName}" }, + { $"Media {projName}", $"{subSiteUrl}/Media%20{projName}" }, + { $"SottoCommesse {projName}", $"{subSiteUrl}/SottoCommesse%20{projName}" } + }; + return itemQuickMenu; + } + public static Dictionary GetProjectDocLib(string ssProjectTitle) + { + var docLibNames = new Dictionary + { + { $"Documenti {ssProjectTitle}", ListTemplateType.DocumentLibrary }, + { $"Media {ssProjectTitle}", ListTemplateType.PictureLibrary }, + { $"SottoCommesse {ssProjectTitle}", ListTemplateType.DocumentLibrary }, + { $"Commerciale {ssProjectTitle}", ListTemplateType.DocumentLibrary }, + }; + return docLibNames; + } + + public static IEnumerable SubProjectDocSet + { + get + { + return new string[] + { + "09_Documenti_Tecnici", + "12_Disegni_Costruttivi", + "13_Manuali", + "15_Documentazione_Elettrica", + "16_Liste_Ricambi" + }; + } + } +} \ No newline at end of file diff --git a/console_spo_utils/Enums/FieldType.cs b/console_spo_utils/Enums/FieldType.cs new file mode 100644 index 0000000..2ce2db5 --- /dev/null +++ b/console_spo_utils/Enums/FieldType.cs @@ -0,0 +1,8 @@ +namespace console_spo_utils.Enums +{ + public enum PalFieldType + { + Project, + Quotation + } +} diff --git a/console_spo_utils/Fakes/Repositories/FakeProjectSettingsRepository.cs b/console_spo_utils/Fakes/Repositories/FakeProjectSettingsRepository.cs new file mode 100644 index 0000000..ae50ebf --- /dev/null +++ b/console_spo_utils/Fakes/Repositories/FakeProjectSettingsRepository.cs @@ -0,0 +1,16 @@ +using console_spo_utils.Interfaces.Repositories; + +namespace console_spo_utils.Fakes.Repositories; + +public class FakeProjectSettingsRepository:IProjectSettingsRepository +{ + public string DefaultDlvReason(string projName) + { + return "02 VENDITA RICAMBI"; + } + + public string DefaultCostumer(string projName) + { + return "PAL"; + } +} \ No newline at end of file diff --git a/console_spo_utils/Fakes/Repositories/FakeSubProjectRepository.cs b/console_spo_utils/Fakes/Repositories/FakeSubProjectRepository.cs new file mode 100644 index 0000000..16ac57f --- /dev/null +++ b/console_spo_utils/Fakes/Repositories/FakeSubProjectRepository.cs @@ -0,0 +1,17 @@ +using console_spo_utils.Interfaces.Repositories; + +namespace console_spo_utils.Fakes.Repositories; + +public class FakeSubProjectRepository:ISubProjectRepository +{ + public List GetFromProject(string projName) + { + return new List() + { + $"{projName}-001", + $"{projName}-002", + $"{projName}-003", + $"{projName}-004", + }; + } +} \ No newline at end of file diff --git a/console_spo_utils/Interfaces/Repositories/IProjectSettingsRepository.cs b/console_spo_utils/Interfaces/Repositories/IProjectSettingsRepository.cs new file mode 100644 index 0000000..4e55297 --- /dev/null +++ b/console_spo_utils/Interfaces/Repositories/IProjectSettingsRepository.cs @@ -0,0 +1,7 @@ +namespace console_spo_utils.Interfaces.Repositories; + +public interface IProjectSettingsRepository +{ + public string DefaultDlvReason(string projName); + public string DefaultCostumer(string projName); +} \ No newline at end of file diff --git a/console_spo_utils/Interfaces/Repositories/ISubProjectRepository.cs b/console_spo_utils/Interfaces/Repositories/ISubProjectRepository.cs new file mode 100644 index 0000000..b1f22dd --- /dev/null +++ b/console_spo_utils/Interfaces/Repositories/ISubProjectRepository.cs @@ -0,0 +1,6 @@ +namespace console_spo_utils.Interfaces.Repositories; + +public interface ISubProjectRepository +{ + public List GetFromProject(string projName); +} \ No newline at end of file diff --git a/console_spo_utils/Interfaces/Services/IOneNoteService.cs b/console_spo_utils/Interfaces/Services/IOneNoteService.cs new file mode 100644 index 0000000..6b3ea22 --- /dev/null +++ b/console_spo_utils/Interfaces/Services/IOneNoteService.cs @@ -0,0 +1,10 @@ +using Microsoft.SharePoint.Client; + +namespace console_spo_utils.Interfaces.Services; + +public interface IOneNoteService +{ + public bool CreateFolderInsideProject(string projName, ClientContext ctx); + public bool CreateFolderInsideQuotation(string quotationName, ClientContext ctx); + public void EnableFeature(ClientContext ctx); +} \ No newline at end of file diff --git a/console_spo_utils/Interfaces/Services/IProjectDocLibraryService.cs b/console_spo_utils/Interfaces/Services/IProjectDocLibraryService.cs new file mode 100644 index 0000000..dd22222 --- /dev/null +++ b/console_spo_utils/Interfaces/Services/IProjectDocLibraryService.cs @@ -0,0 +1,8 @@ +using Microsoft.SharePoint.Client; + +namespace console_spo_utils.Interfaces.Services; + +public interface IProjectDocLibraryService +{ + void Create(string projName, ClientContext subSiteContext); +} \ No newline at end of file diff --git a/console_spo_utils/Interfaces/Services/IProjectQuickMenuService.cs b/console_spo_utils/Interfaces/Services/IProjectQuickMenuService.cs new file mode 100644 index 0000000..68ede0b --- /dev/null +++ b/console_spo_utils/Interfaces/Services/IProjectQuickMenuService.cs @@ -0,0 +1,8 @@ +using Microsoft.SharePoint.Client; + +namespace console_spo_utils.Interfaces.Services; + +public interface IProjectQuickMenuService +{ + void CreateForProject(string projNames, ClientContext subSiteContext); +} \ No newline at end of file diff --git a/console_spo_utils/Interfaces/Services/IProjectYearService.cs b/console_spo_utils/Interfaces/Services/IProjectYearService.cs new file mode 100644 index 0000000..f45c0da --- /dev/null +++ b/console_spo_utils/Interfaces/Services/IProjectYearService.cs @@ -0,0 +1,10 @@ +using Microsoft.Extensions.Logging; +using Microsoft.SharePoint.Client; + +namespace console_spo_utils.Interfaces.Services; + +public interface IProjectYearService +{ + public void ProjectsYList(string listTitle, ClientContext ctx); + +} \ No newline at end of file diff --git a/console_spo_utils/Interfaces/Services/IQuotationBuildService.cs b/console_spo_utils/Interfaces/Services/IQuotationBuildService.cs new file mode 100644 index 0000000..2c35474 --- /dev/null +++ b/console_spo_utils/Interfaces/Services/IQuotationBuildService.cs @@ -0,0 +1,6 @@ +namespace console_spo_utils.Interfaces.Services; + +public interface IQuotationBuildService +{ + void CreateIfNotExists(string quotationName); +} \ No newline at end of file diff --git a/console_spo_utils/Interfaces/Services/IQuotationDocLibraryService.cs b/console_spo_utils/Interfaces/Services/IQuotationDocLibraryService.cs new file mode 100644 index 0000000..5f385df --- /dev/null +++ b/console_spo_utils/Interfaces/Services/IQuotationDocLibraryService.cs @@ -0,0 +1,8 @@ +using Microsoft.SharePoint.Client; + +namespace console_spo_utils.Interfaces.Services; + +public interface IQuotationDocLibraryService +{ + public void Create(string libName, ClientContext ctx); +} \ No newline at end of file diff --git a/console_spo_utils/Interfaces/Services/IQuotationDocSetService.cs b/console_spo_utils/Interfaces/Services/IQuotationDocSetService.cs new file mode 100644 index 0000000..003a7ee --- /dev/null +++ b/console_spo_utils/Interfaces/Services/IQuotationDocSetService.cs @@ -0,0 +1,8 @@ +using Microsoft.SharePoint.Client; + +namespace console_spo_utils.Interfaces.Services; + +public interface IQuotationDocSetService +{ + public void Create(string quotationName, string docLibraryName, string tenantName, ClientContext ctx); +} \ No newline at end of file diff --git a/console_spo_utils/Interfaces/Services/IRightsService.cs b/console_spo_utils/Interfaces/Services/IRightsService.cs new file mode 100644 index 0000000..f8731b9 --- /dev/null +++ b/console_spo_utils/Interfaces/Services/IRightsService.cs @@ -0,0 +1,8 @@ +using Microsoft.SharePoint.Client; + +namespace console_spo_utils.Interfaces.Services; + +public interface IRightsService +{ + void DomainGroupRights(ClientContext ctx, string tenantName, string docLibName = ""); +} \ No newline at end of file diff --git a/console_spo_utils/Interfaces/Services/ISharePointAuthenticationManager.cs b/console_spo_utils/Interfaces/Services/ISharePointAuthenticationManager.cs new file mode 100644 index 0000000..64aa96d --- /dev/null +++ b/console_spo_utils/Interfaces/Services/ISharePointAuthenticationManager.cs @@ -0,0 +1,10 @@ +using Microsoft.SharePoint.Client; + +namespace console_spo_utils.Interfaces.Services; + +public interface ISharePointAuthenticationManager +{ + ClientContext GetContext(Uri web); + Task EnsureAccessTokenAsync(Uri resourceUri, string userPrincipalName, string userPassword); + void Dispose(); +} \ No newline at end of file diff --git a/console_spo_utils/Interfaces/Services/ISharePointCustomOperation.cs b/console_spo_utils/Interfaces/Services/ISharePointCustomOperation.cs new file mode 100644 index 0000000..12e6883 --- /dev/null +++ b/console_spo_utils/Interfaces/Services/ISharePointCustomOperation.cs @@ -0,0 +1,15 @@ +using console_spo_utils.Enums; +using Microsoft.SharePoint.Client; + +namespace console_spo_utils.Interfaces.Services; + +public interface ISharePointCustomOperation +{ + bool SiteExist(ClientContext ctx); + bool ListExist(ClientContext ctx, string listTitle); + bool FolderExistsInsideList(ClientContext context, string listTitle, string folderName); + bool SiteFeaturesExist(ClientContext ctx, string featureName); + void PalCustomField(ClientContext ctx, PalFieldType et); + public bool ListContentTypeExist(ClientContext ctx, string listTitle, string contentTypeName); + +} \ No newline at end of file diff --git a/console_spo_utils/Interfaces/Services/ISharePointStructureBuilder.cs b/console_spo_utils/Interfaces/Services/ISharePointStructureBuilder.cs new file mode 100644 index 0000000..9825b0c --- /dev/null +++ b/console_spo_utils/Interfaces/Services/ISharePointStructureBuilder.cs @@ -0,0 +1,7 @@ +namespace console_spo_utils.Interfaces.Services; + +public interface ISharePointStructureBuilder +{ + public bool BuildProject(string projName); + public bool BuildQuotation(string quotationName); +} \ No newline at end of file diff --git a/console_spo_utils/Interfaces/Services/ISiteOptions.cs b/console_spo_utils/Interfaces/Services/ISiteOptions.cs new file mode 100644 index 0000000..ff0a41c --- /dev/null +++ b/console_spo_utils/Interfaces/Services/ISiteOptions.cs @@ -0,0 +1,24 @@ +using System.Security; + +namespace console_spo_utils.Interfaces.Services; + +public interface ISiteOptions +{ + public string TokenEndpoint { get; } + public string DefaultAadAppId { get; } + + public Uri GetProjectSite(); + + public string GetProjTenant(); + + public string GetUser(); + + public SecureString GetPassword(); + + public string GetProjListTitle(); + public Uri GetSubProjSite(string projName); + string GetQuotationTenant(); + Uri GetQuotationSite(); + string GetSubProjList(string projName); + public string GetQuotationLibrary(); +} \ No newline at end of file diff --git a/console_spo_utils/Interfaces/Services/ISiteService.cs b/console_spo_utils/Interfaces/Services/ISiteService.cs new file mode 100644 index 0000000..dd4e584 --- /dev/null +++ b/console_spo_utils/Interfaces/Services/ISiteService.cs @@ -0,0 +1,9 @@ +namespace console_spo_utils.Interfaces.Services; + +public interface ISiteService +{ + public bool CreateProjectSiteIfNotExists(); + + public bool CreateSubSiteIfNotExists(string projName); + public bool CreateQuotationSiteIfNotExists(); +} \ No newline at end of file diff --git a/console_spo_utils/Interfaces/Services/ISubProjectBuilderService.cs b/console_spo_utils/Interfaces/Services/ISubProjectBuilderService.cs new file mode 100644 index 0000000..7495735 --- /dev/null +++ b/console_spo_utils/Interfaces/Services/ISubProjectBuilderService.cs @@ -0,0 +1,8 @@ +using Microsoft.SharePoint.Client; + +namespace console_spo_utils.Interfaces.Services; + +public interface ISubProjectBuilderService +{ + bool SubProjectDocSet(string projName, List subProjTitle); +} \ No newline at end of file diff --git a/console_spo_utils/Interfaces/Services/ISubSiteService.cs b/console_spo_utils/Interfaces/Services/ISubSiteService.cs new file mode 100644 index 0000000..2c88e34 --- /dev/null +++ b/console_spo_utils/Interfaces/Services/ISubSiteService.cs @@ -0,0 +1,9 @@ +using Microsoft.SharePoint.Client; + +namespace console_spo_utils.Interfaces.Services; + +public interface ISubSiteService +{ + bool Create(string projName, ClientContext siteContext); + void AddColumnsToListView(string projName, ClientContext subSiteContext); +} \ No newline at end of file diff --git a/console_spo_utils/Interfaces/Services/ITenantService.cs b/console_spo_utils/Interfaces/Services/ITenantService.cs new file mode 100644 index 0000000..4e1d4fa --- /dev/null +++ b/console_spo_utils/Interfaces/Services/ITenantService.cs @@ -0,0 +1,10 @@ +using console_spo_utils.Enums; +using System.Security; + +namespace console_spo_utils.Interfaces.Services; + +public interface ITenantService +{ + public void CreateForProject(); + public void CreateForQuotation(); +} \ No newline at end of file diff --git a/console_spo_utils/Model/ParentProj.cs b/console_spo_utils/Model/ParentProj.cs new file mode 100644 index 0000000..e9a503d --- /dev/null +++ b/console_spo_utils/Model/ParentProj.cs @@ -0,0 +1,11 @@ +namespace console_spo_utils.Model +{ + public class ParentProj + { + public string ProjId { get; set; } + public string Description { get; set; } + public string Customer { get; set; } + public string DeliveryReason { get; set; } + public List SubProjects { get; set; } + } +} diff --git a/console_spo_utils/Model/SubProj.cs b/console_spo_utils/Model/SubProj.cs new file mode 100644 index 0000000..6da8c97 --- /dev/null +++ b/console_spo_utils/Model/SubProj.cs @@ -0,0 +1,15 @@ +namespace console_spo_utils.Model +{ + public class SubProj + { + public string ProjId { get; set; } + public string Description { get; set; } + public string Customer { get; set; } + public string DeliveryReason { get; set; } + public string Position { get; set; } + public string ItemCode { get; set; } + public string ItemDescription { get; set; } + public string SerialNumber { get; set; } + + } +} diff --git a/console_spo_utils/Model/TokenWaitInfo.cs b/console_spo_utils/Model/TokenWaitInfo.cs new file mode 100644 index 0000000..80000d7 --- /dev/null +++ b/console_spo_utils/Model/TokenWaitInfo.cs @@ -0,0 +1,7 @@ +namespace console_spo_utils.Model +{ + internal class TokenWaitInfo + { + public RegisteredWaitHandle Handle = null; + } +} diff --git a/console_spo_utils/Model/XmlFieldsModel.cs b/console_spo_utils/Model/XmlFieldsModel.cs new file mode 100644 index 0000000..b18bcea --- /dev/null +++ b/console_spo_utils/Model/XmlFieldsModel.cs @@ -0,0 +1,60 @@ +using System.Xml.Serialization; + +namespace console_spo_utils.Model; +[XmlRoot(ElementName = "Field")] + +public class XmlFieldsModel +{ + [XmlAttribute(AttributeName = "Name")] + public string Name { get; set; } + [XmlAttribute(AttributeName = "Type")] + public string Type { get; set; } + [XmlAttribute(AttributeName = "Description")] + public string Description { get; set; } + [XmlAttribute(AttributeName = "DisplayName")] + public string DisplayName { get; set; } + [XmlAttribute(AttributeName = "StaticName")] + public string StaticName { get; set; } + [XmlAttribute(AttributeName = "Group")] + public string Group { get; set; } + [XmlAttribute(AttributeName = "Hidden")] + public string Hidden { get; set; } + [XmlAttribute(AttributeName = "Required")] + public string Required { get; set; } + [XmlAttribute(AttributeName = "Sealed")] + public string Sealed { get; set; } + [XmlAttribute(AttributeName = "ShowInDisplayForm")] + public string ShowInDisplayForm { get; set; } + [XmlAttribute(AttributeName = "ShowInEditForm")] + public string ShowInEditForm { get; set; } + [XmlAttribute(AttributeName = "ShowInNewForm")] + public string ShowInNewForm { get; set; } + + + + public static string ParseToString(string fieldKey, List fieldValue) + { + var model = ParseFromString(fieldKey, fieldValue); + + var xmlSerializer = new XmlSerializer(model.GetType()); + + using StringWriter textWriter = new StringWriter(); + xmlSerializer.Serialize(textWriter, model); + return textWriter.ToString(); + } + + + + public static XmlFieldsModel ParseFromString(string fieldKey, List fieldValue) + { + + // var fieldXml = $""; + + return new XmlFieldsModel() + { + Name = fieldKey, + Type = fieldValue[0], + + }; + } +} \ No newline at end of file diff --git a/console_spo_utils/Program.cs b/console_spo_utils/Program.cs index ae81ce8..0e9fdef 100644 --- a/console_spo_utils/Program.cs +++ b/console_spo_utils/Program.cs @@ -1,1348 +1,61 @@ -using Microsoft.IdentityModel.Tokens; -using Microsoft.Online.SharePoint.TenantAdministration; -using Microsoft.SharePoint.Client; -using Microsoft.SharePoint.Client.DocumentSet; -using Microsoft.SharePoint.Client.WebParts; -//using PnP.Core.Model.SharePoint; -using System; -//using PnP.Core.Model.SharePoint; -//using PnP.Core.Services; -using System.Collections.Concurrent; -using System.Drawing.Text; -using System.Net; -using System.Reflection.PortableExecutable; -using System.Security; -using System.Text; -using System.Text.Json; -using System.Web; -using SP = Microsoft.SharePoint.Client; -using spc = SharePointOnlineUtils.SharePointCustomOperation; +using console_spo_utils.Fakes.Repositories; +using console_spo_utils.Interfaces.Repositories; +using console_spo_utils.Interfaces.Services; +using console_spo_utils.Services; +using console_spo_utils.Workers; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; -namespace SharePointOnlineUtils +namespace console_spo_utils { #region External Variable // TODO: Import variable from PP [C:\Sources\VS\web_portal\webapp_italsort\DataItalsortGestionale\ProjTable.cs] - public class ParentProj - { - public string ProjId { get; set; } - public string Description { get; set; } - public string Customer { get; set; } - public string DeliveryReason { get; set; } - public List SubProjects { get; set; } - } - public class SubProj - { - public string ProjId { get; set; } - public string Description { get; set; } - public string Customer { get; set; } - public string DeliveryReason { get; set; } - public string Position { get; set; } - public string ItemCode { get; set; } - public string ItemDescription { get; set; } - public string SerialNumber { get; set; } - } + + #endregion - public class Program + public static class Program { - public static async Task Main() + public static async Task Main(string[] args) { - #region SPO Credential - string siteCollection = "https://italsortbuttrio.sharepoint.com"; - string svcUser = "svcItsSharePointAdmin@italsort.com"; - SecureString svcUserPsw = new NetworkCredential("", "$O,D1XBp1O5.OdjZt86#a=").SecurePassword; - #endregion - - #region General Variable - string year = DateTime.Now.Year.ToString(); - string tenantName = $"Commesse {year}"; - string projectsYear = tenantName.Replace(" ", string.Empty); - string listTitle = $"Lista {tenantName}"; - string ssProjectTitle = "CT0016"; - string[] ssSubProjectTitle = { "CT0016-0001", "CT0016-0002", "CT0016-0003" }; - - Uri site = new Uri($"{siteCollection}/sites/{projectsYear}"); - Uri subSite = new Uri($"{siteCollection}/sites/{projectsYear}/{ssProjectTitle}"); - #endregion - - #region Project - //ProjectsByYearSite(listTitle, varProjSiteName, svcUser, site, svcUserPsw); - //Project(siteCollection, svcUser, svcUserPsw); - //SubProject(siteCollection, svcUser, svcUserPsw); - #endregion - - #region Offer - Offer(siteCollection, svcUser, svcUserPsw); - #endregion - } - - #region Project - public static async Task ProjectsByYearSite(string listTitle, string varProjSiteName, string user, Uri site, SecureString psw) - { - using (var authMgr = new AuthenticationManager()) - using (var ctx = authMgr.GetContext(site, user, psw)) - { - - if (spc.SiteExist(ctx) == false) + var host = Host.CreateDefaultBuilder(args) + .ConfigureServices(services => { - spc.TenantCreation(varProjSiteName, site, user, psw); - spc.PalCustomField(ctx, spc.FieldType.Project); - spc.ProjectsYList(listTitle, ctx); - } - } + + services.AddSharePointExtensions(); + services.AddTransient(); + services.AddTransient(); + services.AddHostedService(); + + }) + .Build(); + + await host.RunAsync(); } - public static async Task Project(string siteCollection, string user, SecureString psw) + public static IServiceCollection AddSharePointExtensions(this IServiceCollection services) { - string year = DateTime.Now.Year.ToString(); - string tenantName = $"Commesse {year}"; - string projectsYear = tenantName.Replace(" ", string.Empty); - string listTitle = $"Lista Commesse {year}"; - string ssProjectTitle = "CT0016"; + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); - Uri site = new Uri($"{siteCollection}/sites/{projectsYear}"); - Uri subSite = new Uri($"{siteCollection}/sites/{projectsYear}/{ssProjectTitle}"); - - var authMgr = new AuthenticationManager(); - var ctx = authMgr.GetContext(site, user, psw); - var sCtx = authMgr.GetContext(subSite, user, psw); - - spc.AddWebPart(ctx, "/sites/Commesse2022/CT0008/SitePages/homepage.aspx"); - - if (spc.SiteExist(ctx) == true && spc.SiteExist(sCtx) == false) - { - #region Site Context - spc.ProjectSubSite(ssProjectTitle, projectsYear, ctx); - spc.OnenoteSPFeature(ctx, tenantName, ssProjectTitle); //TODO verificare - spc.ProjectListEntry(ssProjectTitle, listTitle, projectsYear, ctx); - #endregion - - #region SubSite Context - spc.ProjectDocLib(ssProjectTitle, sCtx); - spc.ProjectSubProjList(ssProjectTitle, sCtx); - spc.ProjectQuickMenu(ssProjectTitle, subSite.ToString(), sCtx); - #endregion - } + return services; } - - public static async Task SubProject(string siteCollection, string user, SecureString psw) - { - string year = DateTime.Now.Year.ToString(); - string projectsYear = $"Commesse{year}"; - string listTitle = $"Lista Commesse {year}"; - string ssProjectTitle = "CT0016"; - string[] ssSubProjectTitle = { "CT0016-0001", "CT0016-0002", "CT0016-0003" }; - - Uri subSite = new Uri($"{siteCollection}/sites/{projectsYear}/{ssProjectTitle}"); - - using (var authMgr = new AuthenticationManager()) - using (var ctx = authMgr.GetContext(subSite, user, psw)) - { - if (spc.SiteExist(ctx)) - spc.SubProjectDocSet(ssProjectTitle, ssSubProjectTitle, ctx); - } - } - #endregion - - #region Offer - public static async Task Offer(string siteCollection, string user, SecureString psw) - { - string year = DateTime.Now.Year.ToString(); - string tenantName = "Offerte"; - string docLibName = $"{tenantName} {year}"; - string quotationName = $"OF0004"; - - Uri site = new Uri($"{siteCollection}/sites/Offerte"); - - var authMgr = new AuthenticationManager(); - var ctx = authMgr.GetContext(site, user, psw); - - spc.OnenoteSPFeature(ctx, string.Empty, string.Empty); - - if (!spc.SiteExist(ctx)) - { - spc.TenantCreation(tenantName, site, user, psw); - } - else if (spc.SiteExist(ctx) && spc.ListExist(ctx, docLibName) == false) - { - spc.PalCustomField(ctx, spc.FieldType.Quotation); - spc.OfferDocLib(docLibName, ctx); - } - else if (spc.SiteExist(ctx) && spc.ListExist(ctx, docLibName) && !spc.FolderExistsInsideList(ctx, docLibName, quotationName)) - { - spc.OfferDocSet(quotationName, docLibName, tenantName, ctx); - } - } - #endregion } - public class SharePointCustomOperation - { - public enum FieldType - { - Project, - Quotation - } - #region Check If Exist - public static bool SiteExist(ClientContext ctx) - { - try - { - Web web = ctx.Web; - ctx.Load(web, w => w.Title); - ctx.ExecuteQuery(); - return true; - } - catch (Exception ex) - { - return false; - } - } - - public static bool ListExist(ClientContext ctx, string listTitle) - { - try - { - List targetList = ctx.Web.Lists.GetByTitle(listTitle); - ctx.ExecuteQuery(); - return true; - } - catch (Exception ex) - { - return false; - } - } - - public static bool FolderExistsInsideList(ClientContext context, string listTitle, string folderName) - { - var folderExists = context.Web.Lists.GetByTitle(listTitle).RootFolder; - context.Load(folderExists, f => f.Folders); - try - { - context.ExecuteQuery(); - - if (folderExists.Folders.Where(fn => fn.Name == folderName).Any()) - { - return true; - } - return false; - } - catch (Exception ex) - { - Console.WriteLine("Could not find folder."); - return false; - } - } - - public static bool ListContentTypeExist(ClientContext ctx, string listTitle, string contentTypeName) - { - - ContentTypeCollection cntCollection = ctx.Web.Lists.GetByTitle(listTitle).ContentTypes; - - ctx.Load(cntCollection, cntyp => cntyp.Include(ct => ct.Name).Where(ct => ct.Name == contentTypeName)); - ctx.ExecuteQuery(); - - if (!cntCollection.Any()) - { - Console.WriteLine(cntCollection.Count); - return false; - } - else - { - Console.WriteLine(cntCollection.Count); - return true; - } - } - - public static bool SiteFeaturesExist(ClientContext ctx, string featureName) - { - var web = ctx.Web; - var wFeatures = web.Features; - ctx.Load(web); - ctx.Load(wFeatures); - ctx.ExecuteQuery(); - - foreach (var wFeature in wFeatures) - { - ctx.Load(wFeature, wf => wf.DisplayName); - ctx.ExecuteQuery(); - - Console.WriteLine(wFeature.DisplayName); - - if (wFeature.DisplayName == featureName) return true; - } - - return false; - } - #endregion - - #region Tenant Creation - public static async Task TenantCreation(string tenantName, Uri site, string user, SecureString psw) - { - Console.WriteLine($"> Inizializzata la fase di creazione del sito '../{tenantName.Replace(" ", string.Empty)}'."); - - string siteAdmin = "https://italsortbuttrio-admin.sharepoint.com"; - - Uri path = new Uri(siteAdmin); - - var authMgr = new AuthenticationManager(); - var tenantCtx = authMgr.GetContext(path, user, psw); - var ctx = authMgr.GetContext(site, user, psw); - try - { - var tenant = new Tenant(tenantCtx); - var scp = new SiteCreationProperties(); - - scp.Url = site.ToString(); - scp.Title = tenantName; - scp.Owner = user; - scp.Template = "SITEPAGEPUBLISHING#0"; - - SpoOperation spo = tenant.CreateSite(scp); - - tenantCtx.Load(tenant); - tenantCtx.Load(spo, i => i.IsComplete); - tenantCtx.ExecuteQuery(); - - while (!spo.IsComplete) - { - Console.WriteLine($"Il sito '../{scp.Title}' è in fase di pubblicazione."); - System.Threading.Thread.Sleep(30000); - spo.RefreshLoad(); - await tenantCtx.ExecuteQueryAsync(); - } - - Console.WriteLine($"> Il sito è stato creato con successo. ({site})"); - - DomainGroupRights(ctx, tenantName, string.Empty); - - OnenoteSPFeature(ctx, string.Empty, string.Empty); - } - catch (Exception ex) { Logger.ConsoleMessage(ex); } - - } - - public static async Task PalCustomField(ClientContext ctx, FieldType et) - { - Dictionary fieldList = new Dictionary(); - - switch (et) - { - case FieldType.Project: - fieldList = new Dictionary() - { - { "PAL_ID_Project", new string[] { "URL", "ID Progetto", "PAL Field", "FALSE", "TRUE", "TRUE", "TRUE", "TRUE", "TRUE", string.Empty } }, - { "PAL_DlvReason", new string[] { "Choice", "Causale", "PAL Field", "FALSE", "TRUE", "TRUE", "TRUE", "TRUE", "TRUE", "01 VENDITA MACCHINE / IMPIANTI02 VENDITA RICAMBI04 VENDITA SERVIZI FUORI COMMESSA08 VENDITA RIPARAZIONI09 ENGINEERING11 VENDITA E LAVORAZ.CONTO TERZI55 PREVENDITENC NON CONFORMITÁ" } }, - { "PAL_Customer", new string[] { "Text", "Cliente", "PAL Field", "FALSE", "TRUE", "TRUE", "TRUE", "TRUE", "TRUE", string.Empty } }, - { "PAL_Item", new string[] { "Text", "Item", "PAL Field", "FALSE", "FALSE", "TRUE", "TRUE", "TRUE", "TRUE", string.Empty } }, - { "PAL_ItemCode", new string[] { "Text", "Codice Articolo", "PAL Field", "FALSE", "FALSE", "TRUE", "TRUE", "TRUE", "TRUE", string.Empty } }, - { "PAL_ItemDescription", new string[] { "Text", "Descrizione Articolo", "PAL Field", "FALSE", "FALSE", "TRUE", "TRUE", "TRUE", "TRUE", string.Empty } }, - { "PAL_SerialNumber", new string[] { "Text", "Matricola Macchina", "PAL Field", "FALSE", "FALSE", "TRUE", "TRUE", "TRUE", "TRUE", string.Empty } } - }; - break; - case FieldType.Quotation: - fieldList = new Dictionary() - { - { "PAL_Quotation_Reason", new string[] { "Choice", "Causale", "PAL Field", "FALSE", "TRUE", "TRUE", "TRUE", "TRUE", "TRUE", $"01 VENDITA MACCHINE / IMPIANTI02 VENDITA RICAMBI04 VENDITA SERVIZI FUORI COMMESSA08 VENDITA RIPARAZIONI09 ENGINEERING11 VENDITA E LAVORAZ.CONTO TERZI55 PREVENDITENC NON CONFORMITÁ" } }, - { "PAL_ID_Quotation", new string[] { "Text", "ID Offerta", "PAL Field", "FALSE", "FALSE", "TRUE", "TRUE", "TRUE", "TRUE", string.Empty } }, - { "PAL_Quotation_Name", new string[] { "Text", "Fornitore", "PAL Field", "FALSE", "FALSE", "TRUE", "TRUE", "TRUE", "TRUE", string.Empty } }, - { "PAL_Authors", new string[] { "Text", "Autore", "PAL Field", "FALSE", "FALSE", "TRUE", "TRUE", "TRUE", "TRUE", string.Empty } } - }; - break; - default: - throw new NotImplementedException("Entity type not found"); - } - - try - { - if (fieldList != null) - { - var site = ctx.Site; - ctx.Load(site, w => w.RootWeb, w => w.RootWeb.Fields); - ctx.ExecuteQuery(); - foreach (KeyValuePair f in fieldList) - { - var fieldXml = $""; - site.RootWeb.Fields.AddFieldAsXml(fieldXml, false, AddFieldOptions.AddToDefaultContentType); - - ctx.Load(site.RootWeb.Fields); - } - } - - ctx.ExecuteQuery(); - } - catch (Exception ex) { Logger.ConsoleMessage(ex); } - } - - public static async Task OnenoteSPFeature(ClientContext ctx, string siteName, string onGroupSection) //TODO: predisposizione per offerte - { - var featureName = "SiteNotebook"; - Guid featureId = new Guid("f151bb39-7c3b-414f-bb36-6bf18872052f"); - - try - { - if (string.IsNullOrEmpty(onGroupSection)) - { - #region Feature Activate - if (!SiteFeaturesExist(ctx, featureName)) - { - ctx.Web.ActivateFeature(featureId); - ctx.ExecuteQuery(); - Console.WriteLine($"> La Feature {featureName} è ora attiva!"); - } - - #endregion - } - else - { - #region Note Group Section - - Console.WriteLine($"> Inizializzata la fase di creazione della sezione {onGroupSection} in OneNote."); - - var list = ctx.Web.Lists.EnsureSiteAssetsLibrary(); - ctx.Load(list, l => l.RootFolder); - ctx.ExecuteQuery(); - - var rPath = ResourcePath.FromDecodedUrl($"{siteName} Notebook/{onGroupSection}"); - list.RootFolder.AddSubFolderUsingPath(rPath); - ctx.ExecuteQuery(); - - Console.WriteLine($"> Completata la fase di creazione della sezione {onGroupSection} in OneNote."); - - #endregion - } - } - catch (Exception ex) { Logger.ConsoleMessage(ex); } - } - #endregion - - #region Projects Years - public static async Task ProjectsYList(string listTitle, ClientContext ctx) - { - try - { - #region New List - Console.WriteLine($"> Inizializzata la fase di creazione della lista '{listTitle}'."); - - Web web = ctx.Web; - ListCreationInformation creationInfo = new ListCreationInformation(); - - creationInfo.Title = listTitle; - creationInfo.TemplateType = (int)ListTemplateType.GenericList; - List oList = web.Lists.Add(creationInfo); - - ctx.ExecuteQuery(); - - ctx.Load(oList, l => l.Fields); - - var fld = oList.Fields.GetByInternalNameOrTitle("Title"); - if (fld != null) - { - fld.Required = false; - fld.SetShowInDisplayForm(false); - fld.SetShowInEditForm(false); - fld.SetShowInNewForm(false); - - oList.Update(); - ctx.ExecuteQuery(); - } - - Console.WriteLine($"> La lista '{listTitle}' è stato creato con successo."); - #endregion - - #region Field - Console.WriteLine($"> Inizializzata la fase di importazione dei campi '{listTitle}'."); - - List list = ctx.Web.Lists.GetByTitle(listTitle); - var siteField = ctx.Site.RootWeb; - ctx.Load(list, l => l.Fields); - ctx.Load(siteField, s => s.Fields); - - ctx.ExecuteQuery(); - - string[] fieldName = { "ID Progetto", "Cliente", "Causale" }; - - foreach (var fn in fieldName) - { - var Fields = siteField.Fields.GetByTitle(fn); - list.Fields.Add(Fields); - } - - ctx.ExecuteQuery(); - - Console.WriteLine($"> Completata la fase di importazione dei campi '{listTitle}'."); - #endregion - - #region View - Console.WriteLine($"> Inizializzata la fase di creazione della ListView '{listTitle}'."); - - var views = list.Views; - - - ViewCreationInformation viewCreation = new ViewCreationInformation(); - - viewCreation.SetAsDefaultView = true; - viewCreation.Title = listTitle; - viewCreation.ViewTypeKind = ViewType.None; - viewCreation.ColumnWidth = "350"; - viewCreation.ViewFields = new string[] { "ID Progetto", "Cliente", "Causale" }; - - var view = views.Add(viewCreation); - - ctx.Load(view); - ctx.ExecuteQuery(); - - Console.WriteLine($"> Completata la fase di creazione della ListView '{viewCreation.Title}'."); - - var customView = views.GetByTitle(viewCreation.Title); - customView.MobileView = true; - customView.MobileDefaultView = true; - - customView.Update(); - ctx.ExecuteQuery(); - - Console.WriteLine($"> Abilitata la visualizzazione su mobile '{viewCreation.Title}'."); - - ctx.Web.RootFolder.WelcomePage = $"Lists/{listTitle}/{listTitle}.aspx"; - - ctx.Web.RootFolder.Update(); - ctx.ExecuteQuery(); - - Console.WriteLine($"> Impostata come HomePage di '{viewCreation.Title}'"); - #endregion - } - catch (Exception ex) { Logger.ConsoleMessage(ex); } - } - #endregion - - #region Project - public static async Task ProjectSubSite(string ssProjectTitle, string projectsYear, ClientContext ctx) - { - try - { - Console.WriteLine($"> Il sito {ssProjectTitle} è in fase di creazione!"); - - WebCreationInformation wci = new WebCreationInformation(); - - wci.Url = ssProjectTitle; - wci.Title = ssProjectTitle; - wci.UseSamePermissionsAsParentSite = true; - wci.WebTemplate = "SITEPAGEPUBLISHING#0"; - - Web web = ctx.Site.RootWeb.Webs.Add(wci); - ctx.ExecuteQuery(); - - Console.WriteLine($"> Il sito {ssProjectTitle} è stato creato con successo!"); - } - catch (Exception ex) { Logger.ConsoleMessage(ex); } - } - - public static async Task ProjectListEntry(string ssProjectTitle, string listTitle, string projectsYear, ClientContext ctx) //TODO: PP var - { - try - { - List list = ctx.Web.Lists.GetByTitle(listTitle); - - ListItemCreationInformation itemCreateInfo = new ListItemCreationInformation(); - ListItem oItem = list.AddItem(itemCreateInfo); - - FieldUrlValue link = new FieldUrlValue(); - link.Url = $"/sites/{projectsYear}/{ssProjectTitle}"; - link.Description = ssProjectTitle; - - oItem["PAL_ID_Project"] = link; - oItem["PAL_Customer"] = "PAL"; - oItem["PAL_DlvReason"] = "02 VENDITA RICAMBI"; - - oItem.Update(); - ctx.ExecuteQuery(); - - Console.WriteLine($"> La Commessa {ssProjectTitle} è stata aggiunta alla lista {listTitle} con successo!"); - } - catch (Exception ex) { Logger.ConsoleMessage(ex); } - } - - public static async Task ProjectDocLib(string ssProjectTitle, ClientContext ctx) //TODO: Da testare - { - #region DocLib - try - { - Dictionary docLibNames = new Dictionary - { - { $"Documenti {ssProjectTitle}", (int)ListTemplateType.DocumentLibrary }, - { $"Media {ssProjectTitle}", (int)ListTemplateType.PictureLibrary }, - { $"SottoCommesse {ssProjectTitle}", (int)ListTemplateType.DocumentLibrary }, - { $"Commerciale {ssProjectTitle}", (int)ListTemplateType.DocumentLibrary }, - }; - - foreach (KeyValuePair kvp in docLibNames) - { - Console.WriteLine($"> Inizializzata la fase di creazione '{kvp.Key}'."); - - Web web = ctx.Web; - ctx.Load(web); - - ListCreationInformation lci = new ListCreationInformation(); - lci.Title = kvp.Key; - lci.TemplateType = kvp.Value; - List list = web.Lists.Add(lci); - - ctx.ExecuteQuery(); - - if (kvp.Key.Contains("Commerciale")) DomainGroupRights(ctx, string.Empty, kvp.Key); - Console.WriteLine($"> '{kvp.Key}' è stato creato con successo."); - } - - #endregion - - #region Dir - Dictionary folderName = new Dictionary - { - { "01_Costificazioni", $"Commerciale {ssProjectTitle}" }, - { "02_Conferma_Ordine", $"Commerciale {ssProjectTitle}" }, - { "03_Amministrazione", $"Commerciale {ssProjectTitle}" }, - { "05_Documenti_di_Spedizione", $"Documenti {ssProjectTitle}" }, - { "07_Service", $"Documenti {ssProjectTitle}" }, - { "08_Specifiche_Tecniche_E_Meeting", $"Documenti {ssProjectTitle}" }, - { "10_Fornitori", $"Documenti {ssProjectTitle}" }, - { "11_Documenti_Tecnici", $"Documenti {ssProjectTitle}" } - }; - - foreach (KeyValuePair kvp in folderName) - { - Console.WriteLine($"> Inizializzata la fase di {kvp.Key} in {kvp.Value}."); - - List list = ctx.Web.Lists.GetByTitle(kvp.Value); - ListItemCreationInformation info = new ListItemCreationInformation(); - info.UnderlyingObjectType = FileSystemObjectType.Folder; - info.LeafName = kvp.Key; - ListItem newItem = list.AddItem(info); - newItem["Title"] = kvp.Key; - newItem.Update(); - ctx.ExecuteQuery(); - - Console.WriteLine($"> {kvp.Key} creato con successo in {kvp.Value}."); - } - } - catch (Exception ex) { Logger.ConsoleMessage(ex); } - #endregion - } - - public static async Task ProjectSubProjList(string ssProjectTitle, ClientContext ctx) - { - try - { - var listTitle = $"SottoCommesse {ssProjectTitle}"; - #region Field - Console.WriteLine($"> Inizializzata la fase di importazione dei campi in 'SottoCommesse {ssProjectTitle}'."); - - Web web = ctx.Web; - List list = web.Lists.GetByTitle(listTitle); - var siteField = ctx.Site.RootWeb; - ctx.Load(list, l => l.Fields); - ctx.Load(siteField, s => s.Fields); - - ctx.ExecuteQuery(); - - string[] fieldName = { "Item", "Codice Articolo", "Descrizione Articolo", "Matricola Macchina" }; - - foreach (var fn in fieldName) - { - var Fields = siteField.Fields.GetByTitle(fn); - list.Fields.Add(Fields); - } - - ctx.ExecuteQuery(); - - Console.WriteLine($"> Completata la fase di importazione dei campi in 'SottoCommesse {ssProjectTitle}'."); - #endregion - - #region View - Console.WriteLine($"> Inizializzata la fase di creazione della ListView '{listTitle}'."); - - var views = list.Views; - - ViewCreationInformation viewCreation = new ViewCreationInformation(); - - viewCreation.SetAsDefaultView = true; - viewCreation.Title = listTitle; - viewCreation.ViewTypeKind = ViewType.None; - viewCreation.ColumnWidth = "350"; - viewCreation.ViewFields = new string[] { "Type", "Name", "Description", "Item", "Codice Articolo", "Descrizione Articolo", "Matricola Macchina", "Modified", "Editor", "Version", }; - - var view = views.Add(viewCreation); - - ctx.Load(view); - ctx.ExecuteQuery(); - - Console.WriteLine($"> Completata la fase di creazione della ListView '{viewCreation.Title}'."); - - var customView = views.GetByTitle(viewCreation.Title); - customView.MobileView = true; - customView.MobileDefaultView = true; - - customView.Update(); - ctx.ExecuteQuery(); - - Console.WriteLine($"> Abilitata la visualizzazione su mobile '{viewCreation.Title}'."); - #endregion - } - catch (Exception ex) { Logger.ConsoleMessage(ex); } - } - - public static async Task ProjectQuickMenu(string ssProjectTitle, string subSiteUrl, ClientContext ctx) - { - try - { - Dictionary itemQuickMenu = new Dictionary - { - { $"Commerciale {ssProjectTitle}", $"{subSiteUrl}/Commerciale%20{ssProjectTitle}" }, - { $"Documenti {ssProjectTitle}", $"{subSiteUrl}/Documenti%20{ssProjectTitle}" }, - { $"Media {ssProjectTitle}", $"{subSiteUrl}/Media%20{ssProjectTitle}" }, - { $"SottoCommesse {ssProjectTitle}", $"{subSiteUrl}/SottoCommesse%20{ssProjectTitle}" } - }; - - NavigationNodeCollection spNavNodeColl = ctx.Web.Navigation.QuickLaunch; - NavigationNodeCreationInformation newNavNode = new NavigationNodeCreationInformation(); - - ctx.Load(ctx.Web, w => w.RootFolder.WelcomePage); - - foreach (KeyValuePair item in itemQuickMenu) - { - - newNavNode.Title = item.Key; - newNavNode.Url = item.Value; - newNavNode.AsLastNode = true; - spNavNodeColl.Add(newNavNode); - - ctx.ExecuteQuery(); - Console.WriteLine($"> Il menu rapido è stato aggiornato in {ssProjectTitle}"); - - - if (item.Key == $"SottoCommesse {ssProjectTitle}") - { - ctx.Web.RootFolder.WelcomePage = $"SottoCommesse%20{ssProjectTitle}/Forms/SottoCommesse%20{ssProjectTitle}.aspx"; - - ctx.Web.RootFolder.Update(); - ctx.ExecuteQuery(); - } - } - } - catch (Exception ex) { Logger.ConsoleMessage(ex); } - } - #endregion - - #region Sub Project - public static async Task SubProjectDocSet(string ssProjectTitle, string[] ssSubProjectTitle, ClientContext ctx) //TODO: Set variabili da PP - { - try - { - #region Context - var listTitle = $"SottoCommesse {ssProjectTitle}"; - var web = ctx.Web; - ctx.Load(web, w => w.Url); - var list = web.Lists.GetByTitle(listTitle); - ctx.Load(list, l => l.RootFolder, l => l.ContentTypes, l => l.Fields, l => l.ContentTypesEnabled); - ctx.ExecuteQuery(); - list.ContentTypesEnabled = true; - list.Update(); - - if (ListContentTypeExist(ctx, listTitle, "Set di documenti") == false) - { - var documentCT = ctx.Site.RootWeb.AvailableContentTypes.GetById("0x0120D5"); - ctx.Load(documentCT); - ctx.ExecuteQuery(); - - var ctDocSet = new ContentTypeCreationInformation() - { - Name = "Set di documenti", - ParentContentType = documentCT - }; - list.ContentTypes.Add(ctDocSet); - - list.Update(); - ctx.ExecuteQuery(); - } - - var ctData = list.ContentTypes.Where(c => c.Name == "Set di documenti"); - var contentType = ctData.FirstOrDefault(); - ctx.Load(contentType); - ctx.ExecuteQuery(); - #endregion - - foreach (string spt in ssSubProjectTitle) - { - if (FolderExistsInsideList(ctx, listTitle, spt) == false) - { - Console.WriteLine($"> Inizializzata la fase di creazione per {spt}."); - - #region DocSet Field Entry - DocumentSet.Create(ctx, list.RootFolder, spt, contentType.Id); - ctx.ExecuteQuery(); - - Console.WriteLine($"> DocumentSet {spt} creata."); - - var dsItem = list.RootFolder.Folders.GetByUrl(spt).ListItemAllFields; - - dsItem["_ExtendedDescription"] = "valueDescription"; - dsItem["PAL_Item"] = "valueItem"; - dsItem["PAL_ItemCode"] = "valueItemCode"; - dsItem["PAL_ItemDescription"] = "valueItemDescription"; - dsItem["PAL_SerialNumber"] = "valueSerialNumber"; - - dsItem.Update(); - ctx.ExecuteQuery(); - - Console.WriteLine($"> Field value update."); - #endregion - - #region SubProject Folder - string[] folderName = { "09_Documenti_Tecnici", "12_Disegni_Costruttivi", "13_Manuali", "15_Documentazione_Elettrica", "16_Liste_Ricambi" }; - - foreach (string name in folderName) - { - Console.WriteLine($"La sotto cartella {name} verrà creata in {spt}"); - var rPath = ResourcePath.FromDecodedUrl($"{spt}/{name}"); - list.RootFolder.AddSubFolderUsingPath(rPath); - } - - ctx.ExecuteQuery(); - - Console.WriteLine($"Le sotto cartelle sono state create con successo in {spt}"); - #endregion - - Console.WriteLine($"> {spt} creato con successo in SottoCommesse {ssProjectTitle}."); - } - } - } - catch (Exception ex) { Logger.ConsoleMessage(ex); } - } - #endregion - - #region Offer - public static async Task OfferDocLib(string docLibName, ClientContext ctx) // TODO: enable one note function - { - try - { - #region New DocLib - Console.WriteLine($"> Inizializzata la fase di creazione '{docLibName}'."); - - Web web = ctx.Web; - ctx.Load(web, w => w.RootFolder.WelcomePage, w => w.Url); - - ListCreationInformation lci = new ListCreationInformation(); - lci.Title = docLibName; - lci.TemplateType = (int)ListTemplateType.DocumentLibrary; - web.Lists.Add(lci); - - ctx.ExecuteQuery(); - Console.WriteLine($"> Completata la fase di creazione '{docLibName}'."); - #endregion - - #region Field - Console.WriteLine($"> Inizializzata la fase di importazione dei campi '{docLibName}'."); - - List list = ctx.Web.Lists.GetByTitle(docLibName); - var siteField = ctx.Site.RootWeb; - ctx.Load(list, l => l.Fields); - ctx.Load(siteField, s => s.Fields); - - ctx.ExecuteQuery(); - - string[] fieldName = { "ID Offerta", "Fornitore", "Causale", "Autore" }; - - foreach (var fn in fieldName) - { - var Fields = siteField.Fields.GetByTitle(fn); - list.Fields.Add(Fields); - } - - ctx.ExecuteQuery(); - - Console.WriteLine($"> Completata la fase di importazione dei campi '{docLibName}'."); - #endregion - - #region View - Console.WriteLine($"> Inizializzata la fase di creazione della ListView '{docLibName}'."); - - var views = list.Views; - - ViewCreationInformation viewCreation = new ViewCreationInformation(); - - viewCreation.SetAsDefaultView = true; - viewCreation.Title = docLibName; - viewCreation.ViewTypeKind = ViewType.None; - viewCreation.ColumnWidth = "350"; - viewCreation.ViewFields = new string[] { "Type", "Name", "ID Offerta", "Fornitore", "Causale", "Autore" }; - - var view = views.Add(viewCreation); - - ctx.Load(view); - ctx.ExecuteQuery(); - - Console.WriteLine($"> Completata la fase di creazione della ListView '{viewCreation.Title}'."); - - var customView = views.GetByTitle(viewCreation.Title); - customView.MobileView = true; - customView.MobileDefaultView = true; - - customView.Update(); - ctx.ExecuteQuery(); - - Console.WriteLine($"> Abilitata la visualizzazione su mobile '{viewCreation.Title}'."); - #endregion - - #region Shortcut on Quickmenu - NavigationNodeCollection spNavNodeColl = web.Navigation.QuickLaunch; - NavigationNodeCreationInformation newNavNode = new NavigationNodeCreationInformation(); - - newNavNode.Title = $"{docLibName}"; - newNavNode.Url = $"{web.Url}/{docLibName.Replace(" ", "%20")}"; - newNavNode.AsLastNode = true; - spNavNodeColl.Add(newNavNode); - - ctx.ExecuteQuery(); - - Console.WriteLine($"> Il menu rapido è stato aggiornato, il collegamemento a {docLibName} è ora disponibile."); - #endregion - } - catch (Exception ex) { Logger.ConsoleMessage(ex); } - } - - public static async Task OfferDocSet(string quotationName, string docLibName, string tenantName, ClientContext ctx) //TODO: add onenote on creation of - { - try - { - #region Context - var web = ctx.Web; - ctx.Load(web, w => w.Url); - List list = web.Lists.GetByTitle(docLibName); - ctx.Load(list, l => l.RootFolder, l => l.ContentTypes, l => l.Fields, l => l.ContentTypesEnabled); - ctx.ExecuteQuery(); - list.ContentTypesEnabled = true; - list.Update(); - - if (ListContentTypeExist(ctx, docLibName, "Set di documenti") == false) - { - var documentCT = ctx.Site.RootWeb.AvailableContentTypes.GetById("0x0120D5"); - ctx.Load(documentCT); - ctx.ExecuteQuery(); - - var ctDocSet = new ContentTypeCreationInformation() - { - Name = "Set di documenti", - ParentContentType = documentCT - }; - list.ContentTypes.Add(ctDocSet); - - list.Update(); - ctx.ExecuteQuery(); - } - - var ctData = list.ContentTypes.Where(c => c.Name == "Set di documenti"); - var contentType = ctData.FirstOrDefault(); - ctx.Load(contentType); - ctx.ExecuteQuery(); - #endregion - - - Console.WriteLine($"> Inizializzata la fase di creazione per {quotationName}."); - - #region DocSet Field Entry - DocumentSet.Create(ctx, list.RootFolder, quotationName, contentType.Id); - ctx.ExecuteQuery(); - - Console.WriteLine($"> DocumentSet {quotationName} creata."); - - var dsItem = list.RootFolder.Folders.GetByUrl(quotationName).ListItemAllFields; - - dsItem["PAL_ID_Quotation"] = "valueItemCode"; - dsItem["PAL_Quotation_Name"] = "valueItemDescription"; - dsItem["PAL_Quotation_Reason"] = "NC NON CONFORMITÁ"; - dsItem["PAL_Authors"] = "Test"; - - dsItem.Update(); - ctx.ExecuteQuery(); - - Console.WriteLine($"> Field value update."); - #endregion - - #region Quotation Folder - string rev = "Rev. 1"; - string[] folderName = { rev, $"{rev}/01_Costificazione", $"{rev}/02_Offerta", $"{rev}/03_Meeting", $"{rev}/04_Corrispondenza", $"{rev}/08_Specifiche_Tecniche", $"{rev}/10_Fornitori", $"{rev}/11_Documenti_Tecnici", $"{rev}/14_Foto" }; - - foreach (string name in folderName) - { - Console.WriteLine($"La sotto cartella {name} verrà creata in {quotationName}"); - var rPath = ResourcePath.FromDecodedUrl($"{quotationName}/{name}"); - list.RootFolder.AddSubFolderUsingPath(rPath); - } - - ctx.ExecuteQuery(); - - OnenoteSPFeature(ctx, tenantName, quotationName); - - Console.WriteLine($"Le sotto cartelle sono state create con successo in {quotationName}"); - #endregion - - Console.WriteLine($"> {quotationName} creato con successo in Offerte/{docLibName}."); - } - catch (Exception ex) { Logger.ConsoleMessage(ex); } - } - #endregion - - #region Rights - public static async Task DomainGroupRights(ClientContext ctx, string tenantName, string docLibName) - { - #region Groups & Privileges - Dictionary itsADGruopRole = new Dictionary() - { - { "ITS-SPO-PROJ-OWNER", "Full Control" }, - { "ITS-SPO-PROJ-DESIGN", "Design" }, - { "ITS-SPO-PROJ-MODIFY", "Edit" }, - { "ITS-SPO-PROJ-COLLABORATE", "Contribute" }, - { "ITS-SPO-PROJ-READ", "Read" } - }; - - Dictionary itsADGruopSalesRole = new Dictionary() - { - { "ITS-SPO-PROJ-OWNER", "Full Control" }, - { "ITS-SPO-PROJ-SALES-MODIFY", "Edit" }, - { "ITS-SPO-PROJ-SALES-READ", "Read" } - }; - #endregion - - Console.WriteLine("> Inizializzata la fase di assegnazione dei ruoli."); - - try - { - if (tenantName.Contains("Commesse")) - { - #region Site Permission Project - Web web = ctx.Web; - - foreach (KeyValuePair role in itsADGruopRole) - { - var adGroup = web.EnsureUser(role.Key); - ctx.Load(adGroup); - - var roleD = web.RoleDefinitions.GetByName(role.Value); - RoleDefinitionBindingCollection roleDB = new RoleDefinitionBindingCollection(ctx); - roleDB.Add(roleD); - - web.RoleAssignments.Add(adGroup, roleDB); - web.Update(); - } - - ctx.ExecuteQuery(); - Console.WriteLine("> Completata la fase di assegnazione dei ruoli."); - #endregion - } - else if (tenantName.Contains("Offerte")) - { - #region Site Permission Quotation - Web web = ctx.Web; - - foreach (KeyValuePair role in itsADGruopSalesRole) - { - var adGroup = web.EnsureUser(role.Key); - ctx.Load(adGroup); - - var roleD = web.RoleDefinitions.GetByName(role.Value); - RoleDefinitionBindingCollection roleDB = new RoleDefinitionBindingCollection(ctx); - roleDB.Add(roleD); - - web.RoleAssignments.Add(adGroup, roleDB); - web.Update(); - } - - ctx.ExecuteQuery(); - Console.WriteLine("> Completata la fase di assegnazione dei ruoli."); - #endregion - } - else if (!string.IsNullOrEmpty(docLibName)) - { - #region DocLib Permission - Web web = ctx.Web; - List list = web.Lists.GetByTitle(docLibName); - ctx.Load(list); - - list.BreakRoleInheritance(false, true); - ctx.ExecuteQuery(); - - foreach (KeyValuePair role in itsADGruopSalesRole) - { - var adGroup = web.EnsureUser(role.Key); - ctx.Load(adGroup); - - var roleD = web.RoleDefinitions.GetByName(role.Value); - RoleDefinitionBindingCollection roleDB = new RoleDefinitionBindingCollection(ctx); - roleDB.Add(roleD); - - list.RoleAssignments.Add(adGroup, roleDB); - list.Update(); - } - ctx.ExecuteQuery(); - Console.WriteLine($"> Completata la fase di assegnazione dei ruoli in {docLibName}."); - #endregion - } - - } - catch (Exception ex) { Logger.ConsoleMessage(ex); } - } - #endregion - - #region WebParts - public static void AddWebPart(ClientContext ctx, string siteUrl) - { - try - { - Web web = ctx.Web; - ctx.Load(web); - ctx.ExecuteQuery(); - - SP.File oFile = ctx.Web.GetFileByServerRelativeUrl(siteUrl); - LimitedWebPartManager limitedWebPartManager = oFile.GetLimitedWebPartManager(PersonalizationScope.Shared); - - string webPartXml = //"" + "" + "My Web PartDefault" + "Use for formatted text, tables, and images." + "true0" + "Normaltrue" + "truetrue" + "truetrue" + "truetrue" + "ModelessDefault" + "Cannot import this Web Part." + "/_layouts/images/mscontl.gif" + "Microsoft.SharePoint, Version=13.0.0.0, Culture=neutral, " + "PublicKeyToken=94de0004b6e3fcc5" + "Microsoft.SharePoint.WebPartPages.ContentEditorWebPart" + "" + "" + " And this is a second paragraph.]]>" + ""; - "" + - "" + - "" + - "" + - "" + - "Cannot import this Web Part." + - "" + - "" + - "" + - "" + - "757981FB-184A-441B-952D-9434BE33DC85" + - "{757981FB-184A-441B-952D-9434BE33DC85}" + - "" + - "" + - "" + - "" + - "" + - "" + - " " + - "
Blah blah blah
" + - "
 
" + - "
And another blah
]]>" + - "
" + - "
" + - "
"; - - WebPartDefinition oWebPartDefinition = limitedWebPartManager.ImportWebPart(webPartXml); - limitedWebPartManager.AddWebPart(oWebPartDefinition.WebPart, "Left", 1); - ctx.ExecuteQuery(); - } - catch (Exception ex) { Logger.ConsoleMessage(ex); } - } - - public static void GetWebPart(ClientContext ctx) - { - Web web = ctx.Web; - ctx.Load(web); - ctx.ExecuteQuery(); - } - #endregion - } - - public class Logger - { - public static void ConsoleMessage(Exception ex) { Console.WriteLine($"!> Qualcosa è andato storto... ( {ex.Message} )\n[\n{ex.StackTrace}\n]"); return; } - } - - public class AuthenticationManager : IDisposable - { - - private static readonly HttpClient httpClient = new HttpClient(); - private const string tokenEndpoint = "https://login.microsoftonline.com/common/oauth2/token"; - - private const string defaultAADAppId = "46e6296e-176f-4ebb-a14b-bdd5678c16e6"; - - - private static readonly SemaphoreSlim semaphoreSlimTokens = new SemaphoreSlim(1); - private AutoResetEvent tokenResetEvent = null; - private readonly ConcurrentDictionary tokenCache = new ConcurrentDictionary(); - private bool disposedValue; - - #region CSOM - internal class TokenWaitInfo - { - public RegisteredWaitHandle Handle = null; - } - - public ClientContext GetContext(Uri web, string userPrincipalName, SecureString userPassword) - { - var context = new ClientContext(web); - - context.ExecutingWebRequest += (sender, e) => - { - string accessToken = EnsureAccessTokenAsync(new Uri($"{web.Scheme}://{web.DnsSafeHost}"), userPrincipalName, new System.Net.NetworkCredential(string.Empty, userPassword).Password).GetAwaiter().GetResult(); - e.WebRequestExecutor.RequestHeaders["Authorization"] = "Bearer " + accessToken; - }; - - return context; - } - - public async Task EnsureAccessTokenAsync(Uri resourceUri, string userPrincipalName, string userPassword) - { - string accessTokenFromCache = TokenFromCache(resourceUri, tokenCache); - if (accessTokenFromCache == null) - { - await semaphoreSlimTokens.WaitAsync().ConfigureAwait(false); - try - { - // No async methods are allowed in a lock section - string accessToken = await AcquireTokenAsync(resourceUri, userPrincipalName, userPassword).ConfigureAwait(false); - Console.WriteLine($"Successfully requested new access token resource {resourceUri.DnsSafeHost} for user {userPrincipalName}"); - AddTokenToCache(resourceUri, tokenCache, accessToken); - - // Register a thread to invalidate the access token once's it's expired - tokenResetEvent = new AutoResetEvent(false); - TokenWaitInfo wi = new TokenWaitInfo(); - wi.Handle = ThreadPool.RegisterWaitForSingleObject( - tokenResetEvent, - async (state, timedOut) => - { - if (!timedOut) - { - TokenWaitInfo internalWaitToken = (TokenWaitInfo)state; - if (internalWaitToken.Handle != null) - { - internalWaitToken.Handle.Unregister(null); - } - } - else - { - try - { - // Take a lock to ensure no other threads are updating the SharePoint Access token at this time - await semaphoreSlimTokens.WaitAsync().ConfigureAwait(false); - RemoveTokenFromCache(resourceUri, tokenCache); - Console.WriteLine($"Cached token for resource {resourceUri.DnsSafeHost} and user {userPrincipalName} expired"); - } - catch (Exception ex) - { - Console.WriteLine($"Something went wrong during cache token invalidation: {ex.Message}"); - RemoveTokenFromCache(resourceUri, tokenCache); - } - finally - { - semaphoreSlimTokens.Release(); - } - } - }, - wi, - (uint)CalculateThreadSleep(accessToken).TotalMilliseconds, - true - ); - - return accessToken; - - } - finally - { - semaphoreSlimTokens.Release(); - } - } - else - { - //Console.WriteLine($"Returning token from cache for resource {resourceUri.DnsSafeHost} and user {userPrincipalName}"); - Console.WriteLine("OK - Execution Query"); - return accessTokenFromCache; - } - } - - private async Task AcquireTokenAsync(Uri resourceUri, string username, string password) - { - string resource = $"{resourceUri.Scheme}://{resourceUri.DnsSafeHost}"; - - var clientId = defaultAADAppId; - var body = $"resource={resource}&client_id={clientId}&grant_type=password&username={HttpUtility.UrlEncode(username)}&password={HttpUtility.UrlEncode(password)}"; - using (var stringContent = new StringContent(body, Encoding.UTF8, "application/x-www-form-urlencoded")) - { - - var result = await httpClient.PostAsync(tokenEndpoint, stringContent).ContinueWith((response) => - { - return response.Result.Content.ReadAsStringAsync().Result; - }).ConfigureAwait(false); - - var tokenResult = JsonSerializer.Deserialize(result); - var token = tokenResult.GetProperty("access_token").GetString(); - return token; - } - } - - private static string TokenFromCache(Uri web, ConcurrentDictionary tokenCache) - { - if (tokenCache.TryGetValue(web.DnsSafeHost, out string accessToken)) - { - return accessToken; - } - - return null; - } - - private static void AddTokenToCache(Uri web, ConcurrentDictionary tokenCache, string newAccessToken) - { - if (tokenCache.TryGetValue(web.DnsSafeHost, out string currentAccessToken)) - { - tokenCache.TryUpdate(web.DnsSafeHost, newAccessToken, currentAccessToken); - } - else - { - tokenCache.TryAdd(web.DnsSafeHost, newAccessToken); - } - } - - private static void RemoveTokenFromCache(Uri web, ConcurrentDictionary tokenCache) - { - tokenCache.TryRemove(web.DnsSafeHost, out string currentAccessToken); - } - - private static TimeSpan CalculateThreadSleep(string accessToken) - { - var token = new System.IdentityModel.Tokens.Jwt.JwtSecurityToken(accessToken); - var lease = GetAccessTokenLease(token.ValidTo); - lease = TimeSpan.FromSeconds(lease.TotalSeconds - TimeSpan.FromMinutes(5).TotalSeconds > 0 ? lease.TotalSeconds - TimeSpan.FromMinutes(5).TotalSeconds : lease.TotalSeconds); - return lease; - } - - private static TimeSpan GetAccessTokenLease(DateTime expiresOn) - { - DateTime now = DateTime.UtcNow; - DateTime expires = expiresOn.Kind == DateTimeKind.Utc ? expiresOn : TimeZoneInfo.ConvertTimeToUtc(expiresOn); - TimeSpan lease = expires - now; - return lease; - } - - protected virtual void Dispose(bool disposing) - { - if (!disposedValue) - { - if (disposing) - { - if (tokenResetEvent != null) - { - tokenResetEvent.Set(); - tokenResetEvent.Dispose(); - } - } - - disposedValue = true; - } - } - - public void Dispose() - { - // Do not change this code. Put cleanup code in 'Dispose(bool disposing)' method - Dispose(disposing: true); - GC.SuppressFinalize(this); - } - #endregion - } } \ No newline at end of file diff --git a/console_spo_utils/Repositories/SubProjectRepository.cs b/console_spo_utils/Repositories/SubProjectRepository.cs new file mode 100644 index 0000000..e16de66 --- /dev/null +++ b/console_spo_utils/Repositories/SubProjectRepository.cs @@ -0,0 +1,11 @@ +using console_spo_utils.Interfaces.Repositories; + +namespace console_spo_utils.Repositories; + +public class SubProjectRepository:ISubProjectRepository +{ + public List GetFromProject(string projName) + { + return new(); + } +} \ No newline at end of file diff --git a/console_spo_utils/Services/AutenticationManager.cs b/console_spo_utils/Services/AutenticationManager.cs new file mode 100644 index 0000000..2b5cfb8 --- /dev/null +++ b/console_spo_utils/Services/AutenticationManager.cs @@ -0,0 +1,209 @@ +using console_spo_utils.Model; +using Microsoft.SharePoint.Client; +using System.Collections.Concurrent; +using System.Text; +using System.Text.Json; +using System.Web; +using Microsoft.Extensions.Logging; +using console_spo_utils.Interfaces.Services; + +namespace console_spo_utils.Services +{ + public sealed class SharePointAuthenticationManager : IDisposable, ISharePointAuthenticationManager + { + private readonly ILogger logger; + private readonly ISiteOptions siteOptions; + + public SharePointAuthenticationManager( + ILogger logger, + ISiteOptions siteOptions) + { + this.logger = logger; + this.siteOptions = siteOptions; + } + + + private static readonly HttpClient HttpClient = new(); + + + + private static readonly SemaphoreSlim SemaphoreSlimTokens = new(1); + private AutoResetEvent tokenResetEvent = null; + private readonly ConcurrentDictionary tokenCache = new(); + private bool disposedValue; + + #region CSOM + + + public ClientContext GetContext(Uri web) + { + var context = new ClientContext(web); + + context.ExecutingWebRequest += (sender, e) => + { + var accessToken = EnsureAccessTokenAsync(new Uri($"{web.Scheme}://{web.DnsSafeHost}"), + siteOptions.GetUser(), + new System.Net.NetworkCredential(string.Empty, siteOptions.GetPassword()).Password) + .GetAwaiter() + .GetResult(); + e.WebRequestExecutor.RequestHeaders["Authorization"] = "Bearer " + accessToken; + }; + + return context; + } + + public async Task EnsureAccessTokenAsync(Uri resourceUri, string userPrincipalName, string userPassword) + { + var accessTokenFromCache = TokenFromCache(resourceUri, tokenCache); + if (accessTokenFromCache == null) + { + await SemaphoreSlimTokens.WaitAsync(); + try + { + // No async methods are allowed in a lock section + var accessToken = await AcquireTokenAsync(resourceUri, userPrincipalName, userPassword); + logger.LogInformation($"Successfully requested new access token resource {resourceUri.DnsSafeHost} for user {userPrincipalName}"); + AddTokenToCache(resourceUri, tokenCache, accessToken); + + // Register a thread to invalidate the access token once's it's expired + tokenResetEvent = new AutoResetEvent(false); + var wi = new TokenWaitInfo(); + wi.Handle = ThreadPool.RegisterWaitForSingleObject( + tokenResetEvent, + (state, timedOut) => + { + if (!timedOut) + { + var internalWaitToken = (TokenWaitInfo)state; + if (internalWaitToken?.Handle is not null) + { + internalWaitToken.Handle.Unregister(null); + } + } + else + { + try + { + // Take a lock to ensure no other threads are updating the SharePoint Access token at this time + SemaphoreSlimTokens.Wait(); + RemoveTokenFromCache(resourceUri, tokenCache); + logger.LogInformation($"Cached token for resource {resourceUri.DnsSafeHost} and user {userPrincipalName} expired"); + } + catch (Exception ex) + { + logger.LogInformation($"Something went wrong during cache token invalidation: {ex.Message}"); + RemoveTokenFromCache(resourceUri, tokenCache); + } + finally + { + SemaphoreSlimTokens.Release(); + } + } + }, + wi, + (uint)CalculateThreadSleep(accessToken).TotalMilliseconds, + true + ); + + return accessToken; + + } + finally + { + SemaphoreSlimTokens.Release(); + } + } + else + { + logger.LogInformation("OK - Execution Query"); + return accessTokenFromCache; + } + } + + private async Task AcquireTokenAsync(Uri resourceUri, string username, string password) + { + var resource = $"{resourceUri.Scheme}://{resourceUri.DnsSafeHost}"; + + var clientId = siteOptions.DefaultAadAppId; + var body = $"resource={resource}&client_id={clientId}&grant_type=password&username={HttpUtility.UrlEncode(username)}&password={HttpUtility.UrlEncode(password)}"; + using var stringContent = new StringContent(body, Encoding.UTF8, "application/x-www-form-urlencoded"); + var result = await HttpClient.PostAsync(siteOptions.TokenEndpoint, stringContent).ContinueWith((response) => + { + return response.Result.Content.ReadAsStringAsync().Result; + }).ConfigureAwait(false); + + var tokenResult = JsonSerializer.Deserialize(result); + var token = tokenResult.GetProperty("access_token").GetString(); + return token; + } + + private static string TokenFromCache(Uri web, ConcurrentDictionary tokenCache) + { + if (tokenCache.TryGetValue(web.DnsSafeHost, out var accessToken)) + { + return accessToken; + } + + return null; + } + + private static void AddTokenToCache(Uri web, ConcurrentDictionary tokenCache, string newAccessToken) + { + if (tokenCache.TryGetValue(web.DnsSafeHost, out var currentAccessToken)) + { + tokenCache.TryUpdate(web.DnsSafeHost, newAccessToken, currentAccessToken); + } + else + { + tokenCache.TryAdd(web.DnsSafeHost, newAccessToken); + } + } + + private static void RemoveTokenFromCache(Uri web, ConcurrentDictionary tokenCache) + { + tokenCache.TryRemove(web.DnsSafeHost, out _); + } + + private static TimeSpan CalculateThreadSleep(string accessToken) + { + var token = new System.IdentityModel.Tokens.Jwt.JwtSecurityToken(accessToken); + var lease = GetAccessTokenLease(token.ValidTo); + lease = TimeSpan.FromSeconds(lease.TotalSeconds - TimeSpan.FromMinutes(5).TotalSeconds > 0 ? lease.TotalSeconds - TimeSpan.FromMinutes(5).TotalSeconds : lease.TotalSeconds); + return lease; + } + + private static TimeSpan GetAccessTokenLease(DateTime expiresOn) + { + var now = DateTime.UtcNow; + var expires = expiresOn.Kind == DateTimeKind.Utc ? expiresOn : TimeZoneInfo.ConvertTimeToUtc(expiresOn); + var lease = expires - now; + return lease; + } + + private void Dispose(bool disposing) + { + if (disposedValue) + { + return; + } + if (disposing) + { + if (tokenResetEvent is not null) + { + tokenResetEvent.Set(); + tokenResetEvent.Dispose(); + } + } + + disposedValue = true; + } + + public void Dispose() + { + // Do not change this code. Put cleanup code in 'Dispose(bool disposing)' method + Dispose(disposing: true); + GC.SuppressFinalize(this); + } + #endregion + } +} diff --git a/console_spo_utils/Services/OfferService.cs b/console_spo_utils/Services/OfferService.cs new file mode 100644 index 0000000..b3fb437 --- /dev/null +++ b/console_spo_utils/Services/OfferService.cs @@ -0,0 +1,234 @@ +//using Microsoft.SharePoint.Client.DocumentSet; +//using Microsoft.SharePoint.Client; +//using System.Security; +//using console_spo_utils.Enums; +//using Microsoft.AddSharePointExtensions.Logging; + +//namespace console_spo_utils.Services +//{ +// internal class OfferService +// { +// private readonly SharePointCustomOperation spc; + +// private readonly ILogger logger; +// private readonly SharePointAuthenticationManager authMgr; + +// public OfferService( +// SharePointCustomOperation spc, +// ILogger logger, +// SharePointAuthenticationManager authMgr) +// { +// this.spc = spc; +// this.logger = logger; +// this.authMgr = authMgr; +// } + +// public void Create(string siteCollection, string user, SecureString psw) +// { +// var year = DateTime.Now.Year.ToString(); +// var tenantName = "Offerte"; +// var docLibName = $"{tenantName} {year}"; +// var quotationName = $"OF0002"; + +// var site = new Uri($"{siteCollection}/sites/Offerte"); + +// var ctx = authMgr.GetContext(site); + +// //spc.AddWebPart(ctx, "/sites/Offerte/SitePages/homepage.aspx"); + +// if (!spc.SiteExist(ctx)) +// { +// spc.TenantCreation(tenantName, PalFieldType.Quotation, site, user, psw); +// } +// else if (spc.SiteExist(ctx) && spc.ListExist(ctx, docLibName) == false) +// { +// OfferDocLib(docLibName, ctx); +// } +// else if (spc.SiteExist(ctx) && spc.ListExist(ctx, docLibName) && !spc.FolderExistsInsideList(ctx, docLibName, quotationName)) +// { +// OfferDocSet(quotationName, docLibName, tenantName, ctx); +// } +// } + +// public void OfferDocLib(string docLibName, ClientContext ctx) +// { +// try +// { +// #region New DocLib +// logger.LogInformation($"> Inizializzata la fase di creazione '{docLibName}'."); + +// var web = ctx.Web; +// ctx.Load(web, w => w.RootFolder.WelcomePage, w => w.Url); + +// var lci = new ListCreationInformation +// { +// Title = docLibName, +// TemplateType = (int)ListTemplateType.DocumentLibrary +// }; +// web.Lists.Add(lci); + +// ctx.ExecuteQuery(); +// logger.LogInformation($"> Completata la fase di creazione '{docLibName}'."); +// #endregion + +// #region Field +// logger.LogInformation($"> Inizializzata la fase di importazione dei campi '{docLibName}'."); + +// var list = ctx.Web.Lists.GetByTitle(docLibName); +// var siteField = ctx.Site.RootWeb; +// ctx.Load(list, l => l.Fields); +// ctx.Load(siteField, s => s.Fields); + +// ctx.ExecuteQuery(); + +// string[] fieldName = { "ID Offerta", "Fornitore", "Causale", "Autore" }; + +// foreach (var fn in fieldName) +// { +// var fields = siteField.Fields.GetByTitle(fn); +// list.Fields.Add(fields); +// } + +// ctx.ExecuteQuery(); + +// logger.LogInformation($"> Completata la fase di importazione dei campi '{docLibName}'."); +// #endregion + +// #region View +// logger.LogInformation($"> Inizializzata la fase di creazione della ListView '{docLibName}'."); + +// var views = list.Views; + +// var viewCreation = new ViewCreationInformation +// { +// SetAsDefaultView = true, +// Title = docLibName, +// ViewTypeKind = ViewType.None, +// ColumnWidth = "350", +// ViewFields = new string[] { "Type", "Name", "ID Offerta", "Fornitore", "Causale", "Autore" } +// }; + +// var view = views.Add(viewCreation); + +// ctx.Load(view); +// ctx.ExecuteQuery(); + +// logger.LogInformation($"> Completata la fase di creazione della ListView '{viewCreation.Title}'."); + +// var customView = views.GetByTitle(viewCreation.Title); +// customView.MobileView = true; +// customView.MobileDefaultView = true; + +// customView.Update(); +// ctx.ExecuteQuery(); + +// logger.LogInformation($"> Abilitata la visualizzazione su mobile '{viewCreation.Title}'."); +// #endregion + +// #region Shortcut on Quickmenu +// var spNavNodeColl = web.Navigation.QuickLaunch; +// var newNavNode = new NavigationNodeCreationInformation +// { +// Title = $"{docLibName}", +// Url = $"{web.Url}/{docLibName.Replace(" ", "%20")}", +// AsLastNode = true +// }; + +// spNavNodeColl.Add(newNavNode); + +// ctx.ExecuteQuery(); + +// logger.LogInformation($"> Il menu rapido è stato aggiornato, il collegamemento a {docLibName} è ora disponibile."); +// #endregion +// } +// catch (Exception ex) +// { +// logger.LogError("Create Doc Lib", ex); +// } +// } + +// public void OfferDocSet(string quotationName, string docLibName, string tenantName, ClientContext ctx) //TODO: add onenote on creation of +// { +// try +// { +// #region Context +// var web = ctx.Web; +// ctx.Load(web, w => w.Url); +// var list = web.Lists.GetByTitle(docLibName); +// ctx.Load(list, l => l.RootFolder, l => l.ContentTypes, l => l.Fields, l => l.ContentTypesEnabled); +// ctx.ExecuteQuery(); +// list.ContentTypesEnabled = true; +// list.Update(); + +// if (spc.ListContentTypeExist(ctx, docLibName, "Set di documenti") == false) +// { +// var documentCt = ctx.Site.RootWeb.AvailableContentTypes.GetById("0x0120D5"); +// ctx.Load(documentCt); +// ctx.ExecuteQuery(); + +// var ctDocSet = new ContentTypeCreationInformation() +// { +// Name = "Set di documenti", +// ParentContentType = documentCt +// }; +// list.ContentTypes.Add(ctDocSet); + +// list.Update(); +// ctx.ExecuteQuery(); +// } + +// var ctData = list.ContentTypes.Where(c => c.Name == "Set di documenti"); +// var contentType = ctData.FirstOrDefault(); +// ctx.Load(contentType); +// ctx.ExecuteQuery(); +// #endregion + + +// logger.LogInformation($"> Inizializzata la fase di creazione per {quotationName}."); + +// #region DocSet Field Entry +// DocumentSet.Create(ctx, list.RootFolder, quotationName, contentType.Id); +// ctx.ExecuteQuery(); + +// logger.LogInformation($"> DocumentSet {quotationName} creata."); + +// var dsItem = list.RootFolder.Folders.GetByUrl(quotationName).ListItemAllFields; + +// dsItem["PAL_ID_Quotation"] = "valueItemCode"; +// dsItem["PAL_Quotation_Name"] = "valueItemDescription"; +// dsItem["PAL_Quotation_Reason"] = "NC NON CONFORMITÁ"; +// dsItem["PAL_Authors"] = "Test"; + +// dsItem.Update(); +// ctx.ExecuteQuery(); + +// logger.LogInformation($"> Field value update."); +// #endregion + +// #region Quotation Folder +// var rev = "Rev. 1"; +// string[] folderName = { rev, $"{rev}/01_Costificazione", $"{rev}/02_Offerta", $"{rev}/03_Meeting", $"{rev}/04_Corrispondenza", $"{rev}/08_Specifiche_Tecniche", $"{rev}/10_Fornitori", $"{rev}/11_Documenti_Tecnici", $"{rev}/14_Foto" }; + +// foreach (var name in folderName) +// { +// logger.LogInformation($"La sotto cartella {name} verrà creata in {quotationName}"); +// var rPath = ResourcePath.FromDecodedUrl($"{quotationName}/{name}"); +// list.RootFolder.AddSubFolderUsingPath(rPath); +// } + +// ctx.ExecuteQuery(); + +// spc.OnenoteSPFeature(ctx, tenantName, quotationName); + +// logger.LogInformation($"Le sotto cartelle sono state create con successo in {quotationName}"); +// #endregion + +// logger.LogInformation($"> {quotationName} creato con successo in Offerte/{docLibName}."); +// } +// catch (Exception ex) +// { +// logger.LogError("Create Doc Set", ex); +// } +// } +// } +//} diff --git a/console_spo_utils/Services/OneNoteService.cs b/console_spo_utils/Services/OneNoteService.cs new file mode 100644 index 0000000..f0673f4 --- /dev/null +++ b/console_spo_utils/Services/OneNoteService.cs @@ -0,0 +1,91 @@ +using console_spo_utils.Interfaces.Services; +using Microsoft.Extensions.Logging; +using Microsoft.SharePoint.Client; + +namespace console_spo_utils.Services; + +public class OneNoteService : IOneNoteService +{ + private readonly ILogger logger; + private readonly ISiteOptions siteOptions; + private readonly ISharePointCustomOperation cpt; + + public OneNoteService( + ILogger logger, + ISiteOptions siteOptions, + ISharePointCustomOperation cpt) + { + this.logger = logger; + this.siteOptions = siteOptions; + this.cpt = cpt; + } + + public bool CreateFolderInsideProject(string projName, ClientContext ctx) + { + try + { + + logger.LogInformation($"> Inizializzata la fase di creazione della sezione {projName} in OneNote."); + + var list = ctx.Web.Lists.EnsureSiteAssetsLibrary(); + ctx.Load(list, l => l.RootFolder); + ctx.ExecuteQuery(); + + var rPath = ResourcePath.FromDecodedUrl($"{siteOptions.GetProjTenant()} Notebook/{projName}"); + list.RootFolder.AddSubFolderUsingPath(rPath); + ctx.ExecuteQuery(); + + logger.LogInformation($"> Completata la fase di creazione della sezione {projName} in OneNote."); + + } + catch (Exception ex) + { + logger.LogError(ex, "OnenoteSPFeature"); + return false; + } + + return true; + } + public bool CreateFolderInsideQuotation(string quotationName, ClientContext ctx) + { + try + { + + logger.LogInformation($"> Inizializzata la fase di creazione della sezione {quotationName} in OneNote."); + + var list = ctx.Web.Lists.EnsureSiteAssetsLibrary(); + ctx.Load(list, l => l.RootFolder); + ctx.ExecuteQuery(); + + var rPath = ResourcePath.FromDecodedUrl($"{siteOptions.GetQuotationTenant()} Notebook/{quotationName}"); + list.RootFolder.AddSubFolderUsingPath(rPath); + ctx.ExecuteQuery(); + + logger.LogInformation($"> Completata la fase di creazione della sezione {quotationName} in OneNote."); + + } + catch (Exception ex) + { + logger.LogError(ex, "OnenoteSPFeature"); + return false; + } + + return true; + } + + public void EnableFeature(ClientContext ctx) + { + var featureName = "SiteNotebook"; + var featureId = new Guid("f151bb39-7c3b-414f-bb36-6bf18872052f"); + + #region Feature Activate + if (!cpt.SiteFeaturesExist(ctx, featureName)) + { + ctx.Web.ActivateFeature(featureId); + ctx.ExecuteQuery(); + logger.LogInformation($"> La Feature {featureName} è ora attiva!"); + } + + #endregion + } +} \ No newline at end of file diff --git a/console_spo_utils/Services/ProjectDocLibraryService.cs b/console_spo_utils/Services/ProjectDocLibraryService.cs new file mode 100644 index 0000000..08f8f19 --- /dev/null +++ b/console_spo_utils/Services/ProjectDocLibraryService.cs @@ -0,0 +1,86 @@ +using console_spo_utils.Constants; +using console_spo_utils.Interfaces.Services; +using Microsoft.Extensions.Logging; +using Microsoft.SharePoint.Client; + +namespace console_spo_utils.Services; + +public class ProjectDocLibraryService : IProjectDocLibraryService +{ + private readonly ILogger logger; + private readonly IRightsService rightsService; + + public ProjectDocLibraryService( + ILogger logger, + IRightsService rightsService) + { + this.logger = logger; + this.rightsService = rightsService; + } + + + public void Create(string ssProjectTitle, ClientContext ctx) //TODO: Da testare + { + try + { + BuildProjectDocumentLibrary(ssProjectTitle, ctx); + + BuildProjectFolders(ssProjectTitle, ctx); + } + catch (Exception ex) + { + logger.LogError(ex, "Create Doc Lib"); + } + } + + private void BuildProjectFolders(string projName, ClientContext clientContext) + { + var projectFolders = Folders.GetProjectFolders(projName); + + foreach (var (folderName, folderPath) in projectFolders) + { + logger.LogInformation($"> Inizializzata la fase di {folderName} in {folderPath}."); + + var list = clientContext.Web.Lists.GetByTitle(folderPath); + var info = new ListItemCreationInformation + { + UnderlyingObjectType = FileSystemObjectType.Folder, + LeafName = folderName + }; + var newItem = list.AddItem(info); + newItem["Title"] = folderName; + newItem.Update(); + clientContext.ExecuteQuery(); + + logger.LogInformation($"> {folderName} creato con successo in {folderPath}."); + } + } + + private void BuildProjectDocumentLibrary(string projName, ClientContext clientContext) + { + var docLibNames = Folders.GetProjectDocLib(projName); + + foreach (var (libraryName, libraryType) in docLibNames) + { + logger.LogInformation($"> Inizializzata la fase di creazione '{libraryName}'."); + + var web = clientContext.Web; + clientContext.Load(web); + + var lci = new ListCreationInformation + { + Title = libraryName, + TemplateType = (int)libraryType + }; + web.Lists.Add(lci); + clientContext.ExecuteQuery(); + + if (libraryName.Contains("Commerciale")) + { + rightsService.DomainGroupRights(clientContext, string.Empty, libraryName); + } + + logger.LogInformation($"> '{libraryName}' è stato creato con successo."); + } + } +} \ No newline at end of file diff --git a/console_spo_utils/Services/ProjectQuickMenuService.cs b/console_spo_utils/Services/ProjectQuickMenuService.cs new file mode 100644 index 0000000..a74e5cb --- /dev/null +++ b/console_spo_utils/Services/ProjectQuickMenuService.cs @@ -0,0 +1,61 @@ +using console_spo_utils.Constants; +using console_spo_utils.Interfaces.Services; +using Microsoft.Extensions.Logging; +using Microsoft.SharePoint.Client; + +namespace console_spo_utils.Services; + +public class ProjectQuickMenuService : IProjectQuickMenuService +{ + private readonly ILogger logger; + private readonly ISiteOptions siteOptions; + + public ProjectQuickMenuService(ILogger logger + , ISiteOptions siteOptions) + { + this.logger = logger; + this.siteOptions = siteOptions; + } + + + public void CreateForProject(string projName, ClientContext ctx) + { + try + { + var subSiteUrl = siteOptions.GetSubProjSite(projName).ToString(); + var itemQuickMenu = Folders.GetProjectQuickMenu(projName, subSiteUrl); + + var spNavNodeColl = ctx.Web.Navigation.QuickLaunch; + var newNavNode = new NavigationNodeCreationInformation(); + + ctx.Load(ctx.Web, w => w.RootFolder.WelcomePage); + + foreach (var (name, path) in itemQuickMenu) + { + + newNavNode.Title = name; + newNavNode.Url = path; + newNavNode.AsLastNode = true; + spNavNodeColl.Add(newNavNode); + + ctx.ExecuteQuery(); + logger.LogInformation($"> Il menu rapido è stato aggiornato in {projName}"); + + + if (name != $"SottoCommesse {projName}") + { + continue; + } + + ctx.Web.RootFolder.WelcomePage = $"SottoCommesse%20{projName}/Forms/SottoCommesse%20{projName}.aspx"; + + ctx.Web.RootFolder.Update(); + ctx.ExecuteQuery(); + } + } + catch (Exception ex) + { + logger.LogError(ex, "CreateForProject"); + } + } +} \ No newline at end of file diff --git a/console_spo_utils/Services/ProjectYearService.cs b/console_spo_utils/Services/ProjectYearService.cs new file mode 100644 index 0000000..d883e0b --- /dev/null +++ b/console_spo_utils/Services/ProjectYearService.cs @@ -0,0 +1,122 @@ +using console_spo_utils.Interfaces.Services; +using Microsoft.Extensions.Logging; +using Microsoft.SharePoint.Client; + +namespace console_spo_utils.Services; + +public class ProjectYearService:IProjectYearService +{ + private readonly ILogger logger; + + public ProjectYearService( + ILogger logger) + { + this.logger = logger; + } + + public void ProjectsYList(string listTitle, ClientContext ctx) + { + try + { + #region New List + + Console.WriteLine($"> Inizializzata la fase di creazione della lista '{listTitle}'."); + + Web web = ctx.Web; + ListCreationInformation creationInfo = new ListCreationInformation(); + + creationInfo.Title = listTitle; + creationInfo.TemplateType = (int)ListTemplateType.GenericList; + List oList = web.Lists.Add(creationInfo); + + ctx.ExecuteQuery(); + + ctx.Load(oList, l => l.Fields); + + var fld = oList.Fields.GetByInternalNameOrTitle("Title"); + if (fld != null) + { + fld.Required = false; + fld.SetShowInDisplayForm(false); + fld.SetShowInEditForm(false); + fld.SetShowInNewForm(false); + + oList.Update(); + ctx.ExecuteQuery(); + } + + Console.WriteLine($"> La lista '{listTitle}' è stato creato con successo."); + + #endregion + + #region Field + + Console.WriteLine($"> Inizializzata la fase di importazione dei campi '{listTitle}'."); + + List list = ctx.Web.Lists.GetByTitle(listTitle); + var siteField = ctx.Site.RootWeb; + ctx.Load(list, l => l.Fields); + ctx.Load(siteField, s => s.Fields); + + ctx.ExecuteQuery(); + + string[] fieldName = { "ID Progetto", "Cliente", "Causale" }; + + foreach (var fn in fieldName) + { + var Fields = siteField.Fields.GetByTitle(fn); + list.Fields.Add(Fields); + } + + ctx.ExecuteQuery(); + + Console.WriteLine($"> Completata la fase di importazione dei campi '{listTitle}'."); + + #endregion + + #region View + + Console.WriteLine($"> Inizializzata la fase di creazione della ListView '{listTitle}'."); + + var views = list.Views; + + + ViewCreationInformation viewCreation = new ViewCreationInformation(); + + viewCreation.SetAsDefaultView = true; + viewCreation.Title = listTitle; + viewCreation.ViewTypeKind = ViewType.None; + viewCreation.ColumnWidth = "350"; + viewCreation.ViewFields = new string[] { "ID Progetto", "Cliente", "Causale" }; + + var view = views.Add(viewCreation); + + ctx.Load(view); + ctx.ExecuteQuery(); + + Console.WriteLine($"> Completata la fase di creazione della ListView '{viewCreation.Title}'."); + + var customView = views.GetByTitle(viewCreation.Title); + customView.MobileView = true; + customView.MobileDefaultView = true; + + customView.Update(); + ctx.ExecuteQuery(); + + Console.WriteLine($"> Abilitata la visualizzazione su mobile '{viewCreation.Title}'."); + + ctx.Web.RootFolder.WelcomePage = $"Lists/{listTitle}/{listTitle}.aspx"; + + ctx.Web.RootFolder.Update(); + ctx.ExecuteQuery(); + + Console.WriteLine($"> Impostata come HomePage di '{viewCreation.Title}'"); + + #endregion + } + catch (Exception ex) + { + logger.LogError(ex,"Project Years"); + } + } +} \ No newline at end of file diff --git a/console_spo_utils/Services/QuotationBuildService.cs b/console_spo_utils/Services/QuotationBuildService.cs new file mode 100644 index 0000000..87baed9 --- /dev/null +++ b/console_spo_utils/Services/QuotationBuildService.cs @@ -0,0 +1,57 @@ +using console_spo_utils.Interfaces.Services; +using Microsoft.Extensions.Logging; + +namespace console_spo_utils.Services; + +public class QuotationBuildService : IQuotationBuildService +{ + private readonly ISiteOptions siteOptions; + private readonly ISharePointAuthenticationManager sharePointAuthenticationManager; + private readonly ISharePointCustomOperation spc; + private readonly ITenantService tenantService; + private readonly IQuotationDocLibraryService quotationDocLibraryService; + private readonly IQuotationDocSetService quotationDocSetService; + private readonly ILogger logger; + + public QuotationBuildService( + ISiteOptions siteOptions, + ISharePointAuthenticationManager sharePointAuthenticationManager, + ISharePointCustomOperation spc, + ITenantService tenantService, + IQuotationDocLibraryService quotationDocLibraryService, + IQuotationDocSetService quotationDocSetService, + ILogger logger) + { + this.siteOptions = siteOptions; + this.sharePointAuthenticationManager = sharePointAuthenticationManager; + this.spc = spc; + this.tenantService = tenantService; + this.quotationDocLibraryService = quotationDocLibraryService; + this.quotationDocSetService = quotationDocSetService; + this.logger = logger; + } + + public void CreateIfNotExists(string quotationName) + { + var site = siteOptions.GetQuotationSite(); + var ctx = sharePointAuthenticationManager.GetContext(site); + var list = siteOptions.GetQuotationLibrary(); + var tenant = siteOptions.GetQuotationTenant(); + if (!spc.SiteExist(ctx)) + { + tenantService.CreateForQuotation(); + } + else if (!spc.ListExist(ctx, list)) + { + quotationDocLibraryService.Create(list, ctx); + } + else if (!spc.FolderExistsInsideList(ctx, list, quotationName)) + { + quotationDocSetService.Create(quotationName, list, tenant, ctx); + } + else + { + logger.LogInformation($"Quotation with {quotationName} already exist"); + } + } +} \ No newline at end of file diff --git a/console_spo_utils/Services/QuotationDocLibraryService.cs b/console_spo_utils/Services/QuotationDocLibraryService.cs new file mode 100644 index 0000000..ced723e --- /dev/null +++ b/console_spo_utils/Services/QuotationDocLibraryService.cs @@ -0,0 +1,115 @@ +using console_spo_utils.Interfaces.Services; +using Microsoft.Extensions.Logging; +using Microsoft.SharePoint.Client; + +namespace console_spo_utils.Services; + +public class QuotationDocLibraryService : IQuotationDocLibraryService +{ + private readonly ILogger logger; + + public QuotationDocLibraryService( + ILogger logger) + { + this.logger = logger; + } + public void Create(string libName, ClientContext ctx) + { + try + { + #region New DocLib + + Console.WriteLine($"> Inizializzata la fase di creazione '{libName}'."); + + Web web = ctx.Web; + ctx.Load(web, w => w.RootFolder.WelcomePage, w => w.Url); + + ListCreationInformation lci = new ListCreationInformation(); + lci.Title = libName; + lci.TemplateType = (int)ListTemplateType.DocumentLibrary; + web.Lists.Add(lci); + + ctx.ExecuteQuery(); + Console.WriteLine($"> Completata la fase di creazione '{libName}'."); + + #endregion + + #region Field + + Console.WriteLine($"> Inizializzata la fase di importazione dei campi '{libName}'."); + + List list = ctx.Web.Lists.GetByTitle(libName); + var siteField = ctx.Site.RootWeb; + ctx.Load(list, l => l.Fields); + ctx.Load(siteField, s => s.Fields); + + ctx.ExecuteQuery(); + + string[] fieldName = { "ID Offerta", "Fornitore", "Causale", "Autore" }; + + foreach (var fn in fieldName) + { + var Fields = siteField.Fields.GetByTitle(fn); + list.Fields.Add(Fields); + } + + ctx.ExecuteQuery(); + + Console.WriteLine($"> Completata la fase di importazione dei campi '{libName}'."); + + #endregion + + #region View + + Console.WriteLine($"> Inizializzata la fase di creazione della ListView '{libName}'."); + + var views = list.Views; + + ViewCreationInformation viewCreation = new ViewCreationInformation(); + + viewCreation.SetAsDefaultView = true; + viewCreation.Title = libName; + viewCreation.ViewTypeKind = ViewType.None; + viewCreation.ColumnWidth = "350"; + viewCreation.ViewFields = new string[] { "Type", "Name", "ID Offerta", "Fornitore", "Causale", "Autore" }; + + var view = views.Add(viewCreation); + + ctx.Load(view); + ctx.ExecuteQuery(); + + Console.WriteLine($"> Completata la fase di creazione della ListView '{viewCreation.Title}'."); + + var customView = views.GetByTitle(viewCreation.Title); + customView.MobileView = true; + customView.MobileDefaultView = true; + + customView.Update(); + ctx.ExecuteQuery(); + + Console.WriteLine($"> Abilitata la visualizzazione su mobile '{viewCreation.Title}'."); + + #endregion + + #region Shortcut on Quickmenu + + NavigationNodeCollection spNavNodeColl = web.Navigation.QuickLaunch; + NavigationNodeCreationInformation newNavNode = new NavigationNodeCreationInformation(); + + newNavNode.Title = $"{libName}"; + newNavNode.Url = $"{web.Url}/{libName.Replace(" ", "%20")}"; + newNavNode.AsLastNode = true; + spNavNodeColl.Add(newNavNode); + + ctx.ExecuteQuery(); + + Console.WriteLine($"> Il menu rapido è stato aggiornato, il collegamemento a {libName} è ora disponibile."); + + #endregion + } + catch (Exception ex) + { + logger.LogError(ex, ""); + } + } +} \ No newline at end of file diff --git a/console_spo_utils/Services/QuotationDocSetService.cs b/console_spo_utils/Services/QuotationDocSetService.cs new file mode 100644 index 0000000..2d23b2b --- /dev/null +++ b/console_spo_utils/Services/QuotationDocSetService.cs @@ -0,0 +1,116 @@ +using console_spo_utils.Interfaces.Services; +using Microsoft.Extensions.Logging; +using Microsoft.SharePoint.Client; +using Microsoft.SharePoint.Client.DocumentSet; + +namespace console_spo_utils.Services; + +public class QuotationDocSetService : IQuotationDocSetService +{ + private readonly ISharePointCustomOperation cpt; + private readonly ILogger logger; + private readonly IOneNoteService oneNoteService; + + public QuotationDocSetService(ISharePointCustomOperation cpt, + ILogger logger, + IOneNoteService oneNoteService) + { + this.cpt = cpt; + this.logger = logger; + this.oneNoteService = oneNoteService; + } + + public void Create(string quotationName, string docLibraryName, string tenantName, ClientContext ctx) + { + try + { + #region Context + + var web = ctx.Web; + ctx.Load(web, w => w.Url); + List list = web.Lists.GetByTitle(docLibraryName); + ctx.Load(list, l => l.RootFolder, l => l.ContentTypes, l => l.Fields, l => l.ContentTypesEnabled); + ctx.ExecuteQuery(); + list.ContentTypesEnabled = true; + list.Update(); + + if (!cpt.ListContentTypeExist(ctx, docLibraryName, "Set di documenti")) + { + var documentCT = ctx.Site.RootWeb.AvailableContentTypes.GetById("0x0120D5"); + ctx.Load(documentCT); + ctx.ExecuteQuery(); + + var ctDocSet = new ContentTypeCreationInformation() + { + Name = "Set di documenti", + ParentContentType = documentCT + }; + list.ContentTypes.Add(ctDocSet); + + list.Update(); + ctx.ExecuteQuery(); + } + + var ctData = list.ContentTypes.Where(c => c.Name == "Set di documenti"); + var contentType = ctData.FirstOrDefault(); + ctx.Load(contentType); + ctx.ExecuteQuery(); + + #endregion + + + Console.WriteLine($"> Inizializzata la fase di creazione per {quotationName}."); + + #region DocSet Field Entry + + DocumentSet.Create(ctx, list.RootFolder, quotationName, contentType.Id); + ctx.ExecuteQuery(); + + Console.WriteLine($"> DocumentSet {quotationName} creata."); + + var dsItem = list.RootFolder.Folders.GetByUrl(quotationName).ListItemAllFields; + + dsItem["PAL_ID_Quotation"] = "valueItemCode"; + dsItem["PAL_Quotation_Name"] = "valueItemDescription"; + dsItem["PAL_Quotation_Reason"] = "NC NON CONFORMITÁ"; + dsItem["PAL_Authors"] = "Test"; + + dsItem.Update(); + ctx.ExecuteQuery(); + + Console.WriteLine($"> Field value update."); + + #endregion + + #region Quotation Folder + + string rev = "Rev. 1"; + string[] folderName = + { + rev, $"{rev}/01_Costificazione", $"{rev}/02_Offerta", $"{rev}/03_Meeting", $"{rev}/04_Corrispondenza", + $"{rev}/08_Specifiche_Tecniche", $"{rev}/10_Fornitori", $"{rev}/11_Documenti_Tecnici", $"{rev}/14_Foto" + }; + + foreach (string name in folderName) + { + Console.WriteLine($"La sotto cartella {name} verrà creata in {quotationName}"); + var rPath = ResourcePath.FromDecodedUrl($"{quotationName}/{name}"); + list.RootFolder.AddSubFolderUsingPath(rPath); + } + + ctx.ExecuteQuery(); + + oneNoteService.CreateFolderInsideQuotation(quotationName, ctx); + + Console.WriteLine($"Le sotto cartelle sono state create con successo in {quotationName}"); + + #endregion + + Console.WriteLine($"> {quotationName} creato con successo in Offerte/{docLibraryName}."); + } + catch (Exception ex) + { + logger.LogError(ex, ""); + } + } +} \ No newline at end of file diff --git a/console_spo_utils/Services/RightsService.cs b/console_spo_utils/Services/RightsService.cs new file mode 100644 index 0000000..1348392 --- /dev/null +++ b/console_spo_utils/Services/RightsService.cs @@ -0,0 +1,118 @@ +using console_spo_utils.Interfaces.Services; +using Microsoft.Extensions.Logging; +using Microsoft.SharePoint.Client; + +namespace console_spo_utils.Services +{ + public class RightsService : IRightsService + { + private readonly ILogger logger; + + public RightsService(ILogger logger) + { + this.logger = logger; + } + + + #region Rights + public void DomainGroupRights(ClientContext ctx, string tenantName, string docLibName = "") + { + #region Groups & Privileges + var itsAdGroupDictionary = new Dictionary() + { + { "ITS-SPO-PROJ-OWNER", "Full Control" }, + { "ITS-SPO-PROJ-DESIGN", "Design" }, + { "ITS-SPO-PROJ-MODIFY", "Edit" }, + { "ITS-SPO-PROJ-COLLABORATE", "Contribute" }, + { "ITS-SPO-PROJ-READ", "Read" } + }; + + var itsAdGruopSalesRole = new Dictionary() + { + { "ITS-SPO-PROJ-OWNER", "Full Control" }, + { "ITS-SPO-PROJ-SALES-MODIFY", "Edit" }, + { "ITS-SPO-PROJ-SALES-READ", "Read" } + }; + #endregion + + logger.LogInformation("> Inizializzata la fase di assegnazione dei ruoli."); + + try + { + if (tenantName.Contains("Commesse")) + { + #region Site Permission Create + var web = ctx.Web; + + foreach (var role in itsAdGroupDictionary) + { + var adGroup = web.EnsureUser(role.Key); + ctx.Load(adGroup); + + var roleD = web.RoleDefinitions.GetByName(role.Value); + var roleDb = new RoleDefinitionBindingCollection(ctx) { roleD }; + + web.RoleAssignments.Add(adGroup, roleDb); + web.Update(); + } + + ctx.ExecuteQuery(); + logger.LogInformation("> Completata la fase di assegnazione dei ruoli."); + #endregion + } + else if (tenantName.Contains("Offerte")) + { + #region Site Permission Quotation + var web = ctx.Web; + + foreach (var role in itsAdGruopSalesRole) + { + var adGroup = web.EnsureUser(role.Key); + ctx.Load(adGroup); + + var roleD = web.RoleDefinitions.GetByName(role.Value); + var roleDb = new RoleDefinitionBindingCollection(ctx) { roleD }; + + web.RoleAssignments.Add(adGroup, roleDb); + web.Update(); + } + + ctx.ExecuteQuery(); + logger.LogInformation("> Completata la fase di assegnazione dei ruoli."); + #endregion + } + else if (!string.IsNullOrEmpty(docLibName)) + { + #region DocLib Permission + var web = ctx.Web; + var list = web.Lists.GetByTitle(docLibName); + ctx.Load(list); + + list.BreakRoleInheritance(false, true); + ctx.ExecuteQuery(); + + foreach (var role in itsAdGruopSalesRole) + { + var adGroup = web.EnsureUser(role.Key); + ctx.Load(adGroup); + + var roleD = web.RoleDefinitions.GetByName(role.Value); + var roleDb = new RoleDefinitionBindingCollection(ctx) { roleD }; + + list.RoleAssignments.Add(adGroup, roleDb); + list.Update(); + } + ctx.ExecuteQuery(); + logger.LogInformation($"> Completata la fase di assegnazione dei ruoli in {docLibName}."); + #endregion + } + + } + catch (Exception ex) + { + logger.LogError("Rights Service", ex); + } + } + #endregion + } +} diff --git a/console_spo_utils/Services/SharePointCustomOperation.cs b/console_spo_utils/Services/SharePointCustomOperation.cs new file mode 100644 index 0000000..e647080 --- /dev/null +++ b/console_spo_utils/Services/SharePointCustomOperation.cs @@ -0,0 +1,160 @@ +using console_spo_utils.Enums; +using console_spo_utils.Interfaces.Services; +using Microsoft.Extensions.Logging; +using Microsoft.Online.SharePoint.TenantAdministration; +using Microsoft.SharePoint.Client; +using System.Security; +using System.Xml.Linq; +using console_spo_utils.Constants; + +namespace console_spo_utils.Services +{ + public class SharePointCustomOperation : ISharePointCustomOperation + { + private readonly ILogger logger; + private readonly IRightsService rightsService; + private readonly ISharePointAuthenticationManager authMgr; + + public SharePointCustomOperation( + ILogger logger, + IRightsService rightsService, + ISharePointAuthenticationManager authMgr) + { + this.logger = logger; + this.rightsService = rightsService; + this.authMgr = authMgr; + } + + + + #region Check If Exist + public bool SiteExist(ClientContext ctx) + { + try + { + var web = ctx.Web; + ctx.Load(web, w => w.Title); + ctx.ExecuteQuery(); + return true; + } + catch (Exception ex) + { + logger.LogError("Site Exists", ex); + + return false; + } + } + + public bool ListExist(ClientContext ctx, string listTitle) + { + try + { + var targetList = ctx.Web.Lists.GetByTitle(listTitle); + ctx.ExecuteQuery(); + return true; + } + catch (Exception ex) + { + logger.LogError("List Exist", ex); + + return false; + } + } + + public bool FolderExistsInsideList(ClientContext context, string listTitle, string folderName) + { + var folderExists = context.Web.Lists.GetByTitle(listTitle).RootFolder; + context.Load(folderExists, f => f.Folders); + try + { + context.ExecuteQuery(); + + if (folderExists.Folders.Any(fn => fn.Name == folderName)) + { + return true; + } + return false; + } + catch (Exception ex) + { + logger.LogError("Folder Exists Inside List", ex); + + return false; + } + } + + public bool SiteFeaturesExist(ClientContext ctx, string featureName) + { + var web = ctx.Web; + var wFeatures = web.Features; + ctx.Load(web); + ctx.Load(wFeatures); + ctx.ExecuteQuery(); + + foreach (var wFeature in wFeatures) + { + ctx.Load(wFeature, wf => wf.DisplayName); + ctx.ExecuteQuery(); + + logger.LogInformation(wFeature.DisplayName); + + if (wFeature.DisplayName == featureName) return true; + } + + return false; + } + #endregion + public bool ListContentTypeExist(ClientContext ctx, string listTitle, string contentTypeName) + { + + ContentTypeCollection cntCollection = ctx.Web.Lists.GetByTitle(listTitle).ContentTypes; + + ctx.Load(cntCollection, cntyp => cntyp.Include(ct => ct.Name).Where(ct => ct.Name == contentTypeName)); + ctx.ExecuteQuery(); + + if (!cntCollection.Any()) + { + Console.WriteLine(cntCollection.Count); + return false; + } + else + { + Console.WriteLine(cntCollection.Count); + return true; + } + } + + + public void PalCustomField(ClientContext ctx, PalFieldType et) + { + var fieldList = et switch + { + PalFieldType.Project => Fields.ProjectCustomFields, + PalFieldType.Quotation => Fields.QuotationCustomFields, + _ => throw new NotImplementedException("Entity type not found") + }; + + try + { + var site = ctx.Site; + ctx.Load(site, w => w.RootWeb, w => w.RootWeb.Fields); + ctx.ExecuteQuery(); + foreach (var f in fieldList) + { + var fieldXml = $""; + site.RootWeb.Fields.AddFieldAsXml(fieldXml, false, AddFieldOptions.AddToDefaultContentType); + + ctx.Load(site.RootWeb.Fields); + } + + ctx.ExecuteQuery(); + } + catch (Exception ex) + { + logger.LogError("PalCustomField", ex); + } + } + + + } +} diff --git a/console_spo_utils/Services/SharePointStructureBuilderService.cs b/console_spo_utils/Services/SharePointStructureBuilderService.cs new file mode 100644 index 0000000..b821323 --- /dev/null +++ b/console_spo_utils/Services/SharePointStructureBuilderService.cs @@ -0,0 +1,63 @@ +using System.Linq.Expressions; +using console_spo_utils.Interfaces.Repositories; +using console_spo_utils.Interfaces.Services; + +namespace console_spo_utils.Services; + +public class SharePointStructureBuilderService : ISharePointStructureBuilder +{ + private readonly ISiteService siteService; + private readonly ISubProjectRepository subProjectRepository; + private readonly ISubProjectBuilderService subProjectBuilderService; + private readonly IQuotationBuildService quotationBuildService; + + public SharePointStructureBuilderService( + ISiteService siteService, + ISubProjectRepository subProjectRepository, + ISubProjectBuilderService subProjectBuilderService, + IQuotationBuildService quotationBuildService) + { + this.siteService = siteService; + this.subProjectRepository = subProjectRepository; + this.subProjectBuilderService = subProjectBuilderService; + this.quotationBuildService = quotationBuildService; + } + + + public bool BuildProject(string projName) + { + var siteBuilderResult = siteService.CreateProjectSiteIfNotExists(); + if (!siteBuilderResult) + { + throw new Exception($"Impossibile to build site"); + } + var subSiteBuilderResult = siteService.CreateSubSiteIfNotExists(projName); + if (!subSiteBuilderResult) + { + throw new Exception($"Impossibile to build subSite for {projName} "); + } + + + var subProjects = subProjectRepository.GetFromProject(projName); + + var subProjectBuilderResult = subProjectBuilderService.SubProjectDocSet(projName, subProjects); + if (!subProjectBuilderResult) + { + throw new Exception($"Impossibile to build subSite for {projName} "); + } + return true; + } + + public bool BuildQuotation(string quotationName) + { + var siteBuildResult = siteService.CreateQuotationSiteIfNotExists(); + if (!siteBuildResult) + { + throw new Exception($"Impossibile to build site"); + } + + quotationBuildService.CreateIfNotExists(quotationName); + + return true; + } +} \ No newline at end of file diff --git a/console_spo_utils/Services/SiteOptions.cs b/console_spo_utils/Services/SiteOptions.cs new file mode 100644 index 0000000..e538a6f --- /dev/null +++ b/console_spo_utils/Services/SiteOptions.cs @@ -0,0 +1,67 @@ +using System.Net; +using System.Security; +using console_spo_utils.Interfaces.Services; + +namespace console_spo_utils.Services; + +public class SiteOptions : ISiteOptions +{ + + private const string SiteCollection = "https://italsortbuttrio.sharepoint.com"; + public string TokenEndpoint { get; } = "https://login.microsoftonline.com/common/oauth2/token"; + public string DefaultAadAppId { get; } = "46e6296e-176f-4ebb-a14b-bdd5678c16e6"; + public Uri GetProjectSite() + { + return new Uri($"{SiteCollection}/sites/{GetProjTenant().Replace(" ","")}"); + } + + private static int GetYear() + { + return DateTime.Today.Year +1; + } + + public string GetProjTenant() + { + return $"Commesse {GetYear()}"; + } + + public string GetUser() + { + return "svcItsSharePointAdmin@italsort.com"; + } + + public SecureString GetPassword() + { + return new NetworkCredential("", "$O,D1XBp1O5.OdjZt86#a=").SecurePassword; + } + + public string GetProjListTitle() + { + return $"Lista {GetProjTenant()}"; + } + + public Uri GetSubProjSite(string projName) + { + return new Uri($"{GetProjectSite()}/{projName}"); + } + + public string GetQuotationTenant() + { + return "Offerte"; + } + + public string GetQuotationLibrary() + { + return $"Offerte {GetYear()}"; + } + + public Uri GetQuotationSite() + { + return new Uri($"{SiteCollection}/sites/Offerte"); + } + + public string GetSubProjList(string projName) + { + return $"SottoCommesse {projName}"; + } +} \ No newline at end of file diff --git a/console_spo_utils/Services/SiteService.cs b/console_spo_utils/Services/SiteService.cs new file mode 100644 index 0000000..496b5c0 --- /dev/null +++ b/console_spo_utils/Services/SiteService.cs @@ -0,0 +1,165 @@ +using console_spo_utils.Enums; +using console_spo_utils.Interfaces.Repositories; +using console_spo_utils.Interfaces.Services; +using Microsoft.Extensions.Logging; +using Microsoft.SharePoint.Client; + +namespace console_spo_utils.Services; + +public class SiteService : ISiteService +{ + private readonly ILogger logger; + private readonly ISharePointAuthenticationManager authMgr; + private readonly ISharePointCustomOperation spc; + private readonly ISiteOptions siteOptions; + private readonly ISubSiteService subSiteService; + private readonly IOneNoteService oneNoteService; + private readonly IProjectSettingsRepository projectSettingsRepository; + private readonly IProjectDocLibraryService projectDocLibraryService; + private readonly IProjectQuickMenuService projectQuickMenuService; + private readonly ITenantService tenantService; + private readonly IProjectYearService projectYearService; + + public SiteService( + ILogger logger, + ISharePointAuthenticationManager authMgr, + ISharePointCustomOperation spc, + ISiteOptions siteOptions, + ISubSiteService subSiteService, + IOneNoteService oneNoteService, + IProjectSettingsRepository projectSettingsRepository, + IProjectDocLibraryService projectDocLibraryService, + IProjectQuickMenuService projectQuickMenuService, + ITenantService tenantService, + IProjectYearService projectYearService) + { + this.logger = logger; + this.authMgr = authMgr; + this.spc = spc; + this.siteOptions = siteOptions; + this.subSiteService = subSiteService; + this.oneNoteService = oneNoteService; + this.projectSettingsRepository = projectSettingsRepository; + this.projectDocLibraryService = projectDocLibraryService; + this.projectQuickMenuService = projectQuickMenuService; + this.tenantService = tenantService; + this.projectYearService = projectYearService; + } + + public bool CreateProjectSiteIfNotExists() + { + try + { + var site = siteOptions.GetProjectSite(); + var listTitle = siteOptions.GetProjListTitle(); + using var ctx = authMgr.GetContext(site); + if (spc.SiteExist(ctx)) + { + return true; + } + tenantService.CreateForProject(); + projectYearService.ProjectsYList(listTitle,ctx); + + } + catch (Exception e) + { + logger.LogError(e, "Site Service"); + return false; + } + + return true; + } + + public bool CreateSubSiteIfNotExists(string projName) + { + + var projectSite = siteOptions.GetProjectSite(); + var subProjSite = siteOptions.GetSubProjSite(projName); + + var siteContext = authMgr.GetContext(projectSite); + var subSiteContext = authMgr.GetContext(subProjSite); + + if (!spc.SiteExist(siteContext)) + { + throw new Exception($"Site {siteContext.Url} not exists"); + } + + if (spc.SiteExist(subSiteContext)) + { + logger.LogInformation($"The subsite {subSiteContext.Url} already exists"); + return true; + } + var existSubSite = subSiteService.Create(projName, siteContext); + if (!existSubSite) + { + return true; + } + + oneNoteService.CreateFolderInsideProject(projName, siteContext); + + CreateProjectListEntry(projName, siteContext); + + projectDocLibraryService.Create(projName, subSiteContext); + + subSiteService.AddColumnsToListView(projName, subSiteContext); + + projectQuickMenuService.CreateForProject(projName, subSiteContext); + + return true; + } + + public bool CreateQuotationSiteIfNotExists() + { + try + { + var site = siteOptions.GetQuotationSite(); + using var ctx = authMgr.GetContext(site); + if (spc.SiteExist(ctx)) + { + return true; + } + tenantService.CreateForQuotation(); + } + catch (Exception e) + { + logger.LogError(e, "Site Service"); + return false; + } + + return true; + } + + + private void CreateProjectListEntry(string projName, ClientContext ctx) //TODO: PP var + { + try + { + var listTitle = siteOptions.GetProjListTitle(); + var tenant = siteOptions.GetProjTenant().Replace(" ",""); + var list = ctx.Web.Lists.GetByTitle(listTitle); + + var itemCreateInfo = new ListItemCreationInformation(); + var oItem = list.AddItem(itemCreateInfo); + + var link = new FieldUrlValue + { + Url = $"/sites/{tenant}/{projName}", + Description = projName + }; + + oItem["PAL_ID_Project"] = link; + oItem["PAL_Customer"] = projectSettingsRepository.DefaultCostumer(projName); + oItem["PAL_DlvReason"] = projectSettingsRepository.DefaultDlvReason(projName); + + oItem.Update(); + ctx.ExecuteQuery(); + + logger.LogInformation($"> La Commessa {projName} è stata aggiunta alla lista {listTitle} con successo!"); + } + catch (Exception ex) + { + logger.LogError(ex, "Create List Entry"); + } + } + +} \ No newline at end of file diff --git a/console_spo_utils/Services/SubProjectBuilderService.cs b/console_spo_utils/Services/SubProjectBuilderService.cs new file mode 100644 index 0000000..9c9fa24 --- /dev/null +++ b/console_spo_utils/Services/SubProjectBuilderService.cs @@ -0,0 +1,126 @@ +using console_spo_utils.Constants; +using console_spo_utils.Interfaces.Services; +using Microsoft.Extensions.Logging; +using Microsoft.SharePoint.Client.DocumentSet; +using Microsoft.SharePoint.Client; + +namespace console_spo_utils.Services; + +public class SubProjectBuilderService : ISubProjectBuilderService +{ + private readonly ISiteOptions siteOptions; + private readonly ISharePointCustomOperation cpt; + private readonly ISharePointAuthenticationManager authMgr; + private readonly ILogger logger; + + public SubProjectBuilderService(ISiteOptions siteOptions + , ISharePointCustomOperation cpt + , ISharePointAuthenticationManager authMgr, + ILogger logger) + { + this.siteOptions = siteOptions; + this.cpt = cpt; + this.authMgr = authMgr; + this.logger = logger; + } + + + public bool SubProjectDocSet(string projName, List subProjTitle) + { + try + { + #region Context + + var listTitle = siteOptions.GetSubProjList(projName); + var subSite = siteOptions.GetSubProjSite(projName); + var ctx = authMgr.GetContext(subSite); + var web = ctx.Web; + ctx.Load(web, w => w.Url); + var list = web.Lists.GetByTitle(listTitle); + ctx.Load(list, l => l.RootFolder, l => l.ContentTypes, l => l.Fields, l => l.ContentTypesEnabled); + ctx.ExecuteQuery(); + list.ContentTypesEnabled = true; + list.Update(); + + if (cpt.ListContentTypeExist(ctx, listTitle, "Set di documenti") == false) + { + var documentCT = ctx.Site.RootWeb.AvailableContentTypes.GetById("0x0120D5"); + ctx.Load(documentCT); + ctx.ExecuteQuery(); + + var ctDocSet = new ContentTypeCreationInformation() + { + Name = "Set di documenti", + ParentContentType = documentCT + }; + list.ContentTypes.Add(ctDocSet); + + list.Update(); + ctx.ExecuteQuery(); + } + + var ctData = list.ContentTypes.Where(c => c.Name == "Set di documenti"); + var contentType = ctData.FirstOrDefault(); + ctx.Load(contentType); + ctx.ExecuteQuery(); + + #endregion + + foreach (var spt in subProjTitle) + { + if (cpt.FolderExistsInsideList(ctx, listTitle, spt) == false) + { + Console.WriteLine($"> Inizializzata la fase di creazione per {spt}."); + + #region DocSet Field Entry + + DocumentSet.Create(ctx, list.RootFolder, spt, contentType.Id); + ctx.ExecuteQuery(); + + Console.WriteLine($"> DocumentSet {spt} creata."); + + var dsItem = list.RootFolder.Folders.GetByUrl(spt).ListItemAllFields; + + dsItem["_ExtendedDescription"] = "valueDescription"; + dsItem["PAL_Item"] = "valueItem"; + dsItem["PAL_ItemCode"] = "valueItemCode"; + dsItem["PAL_ItemDescription"] = "valueItemDescription"; + dsItem["PAL_SerialNumber"] = "valueSerialNumber"; + + dsItem.Update(); + ctx.ExecuteQuery(); + + Console.WriteLine($"> Field value update."); + + #endregion + + #region SubProject Folder + + + + foreach (var name in Folders.SubProjectDocSet) + { + Console.WriteLine($"La sotto cartella {name} verrà creata in {spt}"); + var rPath = ResourcePath.FromDecodedUrl($"{spt}/{name}"); + list.RootFolder.AddSubFolderUsingPath(rPath); + } + + ctx.ExecuteQuery(); + + Console.WriteLine($"Le sotto cartelle sono state create con successo in {spt}"); + + #endregion + + Console.WriteLine($"> {spt} creato con successo in SottoCommesse {projName}."); + } + } + } + catch (Exception ex) + { + logger.LogError(ex,"Sub Proj Doc Set"); + return false; + } + + return true; + } +} \ No newline at end of file diff --git a/console_spo_utils/Services/SubSiteService.cs b/console_spo_utils/Services/SubSiteService.cs new file mode 100644 index 0000000..7abd617 --- /dev/null +++ b/console_spo_utils/Services/SubSiteService.cs @@ -0,0 +1,114 @@ +using console_spo_utils.Constants; +using console_spo_utils.Interfaces.Services; +using Microsoft.Extensions.Logging; +using Microsoft.SharePoint.Client; + +namespace console_spo_utils.Services; + +public class SubSiteService : ISubSiteService +{ + private readonly ILogger logger; + + public SubSiteService(ILogger logger) + { + this.logger = logger; + } + + + public bool Create(string projName, ClientContext siteContext) + { + try + { + + logger.LogInformation($"> Il sito {projName} è in fase di creazione!"); + + var wci = new WebCreationInformation + { + Url = projName, + Title = projName, + UseSamePermissionsAsParentSite = true, + WebTemplate = "SITEPAGEPUBLISHING#0" + }; + + var web = siteContext.Site.RootWeb.Webs.Add(wci); + siteContext.ExecuteQuery(); + + logger.LogInformation($"> Il sito {projName} è stato creato con successo!"); + } + catch (Exception ex) + { + logger.LogError("Create Sub Site", ex); + return false; + } + + return true; + } + + public void AddColumnsToListView(string ssProjectTitle, ClientContext ctx) + { + try + { + var listTitle = $"SottoCommesse {ssProjectTitle}"; + #region Field + logger.LogInformation($"> Inizializzata la fase di importazione dei campi in 'SottoCommesse {ssProjectTitle}'."); + + var web = ctx.Web; + var list = web.Lists.GetByTitle(listTitle); + var siteField = ctx.Site.RootWeb; + ctx.Load(list, l => l.Fields); + ctx.Load(siteField, s => s.Fields); + + ctx.ExecuteQuery(); + AddFieldsToSubProj(siteField, list, ctx); + + + + logger.LogInformation($"> Completata la fase di importazione dei campi in 'SottoCommesse {ssProjectTitle}'."); + #endregion + + #region View + logger.LogInformation($"> Inizializzata la fase di creazione della ListView '{listTitle}'."); + + var views = list.Views; + + var viewCreation = new ViewCreationInformation + { + SetAsDefaultView = true, + Title = listTitle, + ViewTypeKind = ViewType.None, + ColumnWidth = "350", + ViewFields = new string[] { "Type", "Name", "Description", "Item", "Codice Articolo", "Descrizione Articolo", "Matricola Macchina", "Modified", "Editor", "Version", } + }; + + var view = views.Add(viewCreation); + ctx.Load(view); + ctx.ExecuteQuery(); + + logger.LogInformation($"> Completata la fase di creazione della ListView '{viewCreation.Title}'."); + + var customView = views.GetByTitle(viewCreation.Title); + customView.MobileView = true; + customView.MobileDefaultView = true; + customView.Update(); + ctx.ExecuteQuery(); + + logger.LogInformation($"> Abilitata la visualizzazione su mobile '{viewCreation.Title}'."); + #endregion + + } + catch (Exception ex) + { + logger.LogError("Create Sub Site", ex); + } + } + + private static void AddFieldsToSubProj(Web siteField, List list, ClientContext ctx) + { + foreach (var fieldName in Fields.SubProject) + { + var fields = siteField.Fields.GetByTitle(fieldName); + list.Fields.Add(fields); + } + ctx.ExecuteQuery(); + } +} \ No newline at end of file diff --git a/console_spo_utils/Services/TenantService.cs b/console_spo_utils/Services/TenantService.cs new file mode 100644 index 0000000..74a5908 --- /dev/null +++ b/console_spo_utils/Services/TenantService.cs @@ -0,0 +1,101 @@ +using console_spo_utils.Interfaces.Services; +using Microsoft.Extensions.Logging; +using Microsoft.Online.SharePoint.TenantAdministration; +using System.Security; +using console_spo_utils.Enums; + +namespace console_spo_utils.Services; + +public class TenantService : ITenantService +{ + private readonly ISharePointAuthenticationManager authMgr; + private readonly ISharePointCustomOperation cpt; + private readonly IRightsService rightsService; + private readonly IOneNoteService oneNoteService; + private readonly ILogger logger; + private readonly ISiteOptions siteOptions; + + public TenantService( + ISharePointAuthenticationManager authMgr, + ISharePointCustomOperation cpt, + IRightsService rightsService, + IOneNoteService oneNoteService, + ILogger logger, + ISiteOptions siteOptions) + { + this.authMgr = authMgr; + this.cpt = cpt; + this.rightsService = rightsService; + this.oneNoteService = oneNoteService; + this.logger = logger; + this.siteOptions = siteOptions; + } + + public void CreateForProject() + { + TenantCreation( + siteOptions.GetProjTenant(), + siteOptions.GetProjectSite(), + PalFieldType.Project + ); + } + + public void CreateForQuotation() + { + TenantCreation( + siteOptions.GetQuotationTenant(), + siteOptions.GetQuotationSite(), + PalFieldType.Quotation + ); + } + + public void TenantCreation(string tenantName, Uri site,PalFieldType fieldType) + { + Console.WriteLine($"> Inizializzata la fase di creazione del sito '../{tenantName.Replace(" ", string.Empty)}'."); + + string siteAdmin = "https://italsortbuttrio-admin.sharepoint.com"; + + Uri path = new Uri(siteAdmin); + + var tenantCtx = authMgr.GetContext(path); + var ctx = authMgr.GetContext(site); + try + { + var tenant = new Tenant(tenantCtx); + var scp = new SiteCreationProperties + { + Url = site.ToString(), + Title = tenantName, + Owner = siteOptions.GetUser(), + Template = "SITEPAGEPUBLISHING#0" + }; + + SpoOperation spo = tenant.CreateSite(scp); + + tenantCtx.Load(tenant); + tenantCtx.Load(spo, i => i.IsComplete); + tenantCtx.ExecuteQuery(); + + while (!spo.IsComplete) + { + Console.WriteLine($"Il sito '../{scp.Title}' è in fase di pubblicazione."); + System.Threading.Thread.Sleep(30000); + spo.RefreshLoad(); + tenantCtx.ExecuteQuery(); + } + + Console.WriteLine($"> Il sito è stato creato con successo. ({site})"); + + rightsService.DomainGroupRights(ctx, tenantName, string.Empty); + + oneNoteService.EnableFeature(ctx); + + cpt.PalCustomField(ctx,fieldType); + } + catch (Exception ex) + { + logger.LogError(ex,"Tenant Creation"); + } + + } +} \ No newline at end of file diff --git a/console_spo_utils/Workers/MainWorker.cs b/console_spo_utils/Workers/MainWorker.cs new file mode 100644 index 0000000..a5afb69 --- /dev/null +++ b/console_spo_utils/Workers/MainWorker.cs @@ -0,0 +1,65 @@ +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; +using console_spo_utils.Interfaces.Services; + +namespace console_spo_utils.Workers +{ + internal class MainWorker : BackgroundService + { + private readonly ISharePointStructureBuilder structureBuilder; + private readonly ILogger logger; + + public MainWorker( + ISharePointStructureBuilder structureBuilder, + ILogger logger) + { + this.structureBuilder = structureBuilder; + this.logger = logger; + } + + + protected override async Task ExecuteAsync(CancellationToken stoppingToken) + { + var buildResult = structureBuilder.BuildProject("CT2025"); + + if (!buildResult) + { + logger.LogError("Impossible to create structure"); + return; + } + + + + + //#region SPO Credential + //var siteCollection = "https://italsortbuttrio.sharepoint.com"; + //var svcUser = "svcItsSharePointAdmin@italsort.com"; + //var svcUserPsw = new NetworkCredential("", "$O,D1XBp1O5.OdjZt86#a=").SecurePassword; + //#endregion + + //#region General Variable + //var year = DateTime.Now.Year.ToString(); + //var tenantName = $"Commesse {year}"; + //var projectsYear = tenantName.Replace(" ", string.Empty); + //var listTitle = $"Lista {tenantName}"; + //var ssProjectTitle = "CT0018"; + //string[] ssSubProjectTitle = { $"{ssProjectTitle}-0001", $"{ssProjectTitle}-0002", $"{ssProjectTitle}-0003" }; + + //var site = new Uri($"{siteCollection}/sites/{projectsYear}"); + //var subSite = new Uri($"{siteCollection}/sites/{projectsYear}/{ssProjectTitle}"); + //#endregion + + //#region Create + //projectSiteService.CreateIfNotExists(listTitle, tenantName, svcUser, site, svcUserPsw); + //projectService.Create(siteCollection, svcUser, svcUserPsw, ssProjectTitle); + //subProjectService.Create(siteCollection, svcUser, svcUserPsw,ssProjectTitle, ssSubProjectTitle); + //#endregion + + //#region Create + //offerService.Create(siteCollection, svcUser, svcUserPsw); + //#endregion + + //return Task.CompletedTask; + } + } +} diff --git a/console_spo_utils/bin/Debug/net6.0/console_spo_utils.deps.json b/console_spo_utils/bin/Debug/net6.0/console_spo_utils.deps.json index 077ddfa..f4be04a 100644 --- a/console_spo_utils/bin/Debug/net6.0/console_spo_utils.deps.json +++ b/console_spo_utils/bin/Debug/net6.0/console_spo_utils.deps.json @@ -8,7 +8,10 @@ ".NETCoreApp,Version=v6.0": { "console_spo_utils/1.0.0": { "dependencies": { + "Hangfire.Core": "1.7.31", "Microsoft.AspNetCore.Components.WebAssembly.Authentication": "6.0.8", + "Microsoft.Extensions.Hosting": "6.0.1", + "Microsoft.Extensions.Hosting.Abstractions": "6.0.0", "Microsoft.PowerPlatform.Dataverse.Client": "1.0.9", "Microsoft.SharePoint.Client": "14.0.4762.1000", "Microsoft.SharePointOnline.CSOM": "16.1.22615.12000", @@ -33,6 +36,58 @@ } } }, + "Hangfire.Core/1.7.31": { + "dependencies": { + "Newtonsoft.Json": "13.0.1" + }, + "runtime": { + "lib/netstandard2.0/Hangfire.Core.dll": { + "assemblyVersion": "1.7.31.0", + "fileVersion": "1.7.31.0" + } + }, + "resources": { + "lib/netstandard2.0/ca/Hangfire.Core.resources.dll": { + "locale": "ca" + }, + "lib/netstandard2.0/de/Hangfire.Core.resources.dll": { + "locale": "de" + }, + "lib/netstandard2.0/es/Hangfire.Core.resources.dll": { + "locale": "es" + }, + "lib/netstandard2.0/fa/Hangfire.Core.resources.dll": { + "locale": "fa" + }, + "lib/netstandard2.0/fr/Hangfire.Core.resources.dll": { + "locale": "fr" + }, + "lib/netstandard2.0/nb/Hangfire.Core.resources.dll": { + "locale": "nb" + }, + "lib/netstandard2.0/nl/Hangfire.Core.resources.dll": { + "locale": "nl" + }, + "lib/netstandard2.0/pt-BR/Hangfire.Core.resources.dll": { + "locale": "pt-BR" + }, + "lib/netstandard2.0/pt-PT/Hangfire.Core.resources.dll": { + "locale": "pt-PT" + }, + "lib/netstandard2.0/pt/Hangfire.Core.resources.dll": { + "locale": "pt" + }, + "lib/netstandard2.0/tr-TR/Hangfire.Core.resources.dll": { + "locale": "tr-TR" + }, + "lib/netstandard2.0/zh-TW/Hangfire.Core.resources.dll": { + "locale": "zh-TW" + }, + "lib/netstandard2.0/zh/Hangfire.Core.resources.dll": { + "locale": "zh" + } + } + }, "Microsoft.ApplicationInsights/2.16.0": { "dependencies": { "System.Diagnostics.DiagnosticSource": "6.0.0" @@ -325,6 +380,18 @@ } } }, + "Microsoft.Extensions.Configuration/6.0.0": { + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "6.0.0", + "Microsoft.Extensions.Primitives": "6.0.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Extensions.Configuration.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, "Microsoft.Extensions.Configuration.Abstractions/6.0.0": { "dependencies": { "Microsoft.Extensions.Primitives": "6.0.0" @@ -336,6 +403,85 @@ } } }, + "Microsoft.Extensions.Configuration.Binder/6.0.0": { + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "6.0.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Extensions.Configuration.Binder.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, + "Microsoft.Extensions.Configuration.CommandLine/6.0.0": { + "dependencies": { + "Microsoft.Extensions.Configuration": "6.0.0", + "Microsoft.Extensions.Configuration.Abstractions": "6.0.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Extensions.Configuration.CommandLine.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, + "Microsoft.Extensions.Configuration.EnvironmentVariables/6.0.1": { + "dependencies": { + "Microsoft.Extensions.Configuration": "6.0.0", + "Microsoft.Extensions.Configuration.Abstractions": "6.0.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Extensions.Configuration.EnvironmentVariables.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.222.6406" + } + } + }, + "Microsoft.Extensions.Configuration.FileExtensions/6.0.0": { + "dependencies": { + "Microsoft.Extensions.Configuration": "6.0.0", + "Microsoft.Extensions.Configuration.Abstractions": "6.0.0", + "Microsoft.Extensions.FileProviders.Abstractions": "6.0.0", + "Microsoft.Extensions.FileProviders.Physical": "6.0.0", + "Microsoft.Extensions.Primitives": "6.0.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Extensions.Configuration.FileExtensions.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, + "Microsoft.Extensions.Configuration.Json/6.0.0": { + "dependencies": { + "Microsoft.Extensions.Configuration": "6.0.0", + "Microsoft.Extensions.Configuration.Abstractions": "6.0.0", + "Microsoft.Extensions.Configuration.FileExtensions": "6.0.0", + "Microsoft.Extensions.FileProviders.Abstractions": "6.0.0", + "System.Text.Json": "6.0.2" + }, + "runtime": { + "lib/netstandard2.1/Microsoft.Extensions.Configuration.Json.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, + "Microsoft.Extensions.Configuration.UserSecrets/6.0.1": { + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "6.0.0", + "Microsoft.Extensions.Configuration.Json": "6.0.0", + "Microsoft.Extensions.FileProviders.Abstractions": "6.0.0", + "Microsoft.Extensions.FileProviders.Physical": "6.0.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Extensions.Configuration.UserSecrets.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.222.6406" + } + } + }, "Microsoft.Extensions.DependencyInjection/6.0.0": { "dependencies": { "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", @@ -356,6 +502,82 @@ } } }, + "Microsoft.Extensions.FileProviders.Abstractions/6.0.0": { + "dependencies": { + "Microsoft.Extensions.Primitives": "6.0.0" + }, + "runtime": { + "lib/net6.0/Microsoft.Extensions.FileProviders.Abstractions.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, + "Microsoft.Extensions.FileProviders.Physical/6.0.0": { + "dependencies": { + "Microsoft.Extensions.FileProviders.Abstractions": "6.0.0", + "Microsoft.Extensions.FileSystemGlobbing": "6.0.0", + "Microsoft.Extensions.Primitives": "6.0.0" + }, + "runtime": { + "lib/net6.0/Microsoft.Extensions.FileProviders.Physical.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, + "Microsoft.Extensions.FileSystemGlobbing/6.0.0": { + "runtime": { + "lib/net6.0/Microsoft.Extensions.FileSystemGlobbing.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, + "Microsoft.Extensions.Hosting/6.0.1": { + "dependencies": { + "Microsoft.Extensions.Configuration": "6.0.0", + "Microsoft.Extensions.Configuration.Abstractions": "6.0.0", + "Microsoft.Extensions.Configuration.Binder": "6.0.0", + "Microsoft.Extensions.Configuration.CommandLine": "6.0.0", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", + "Microsoft.Extensions.Configuration.FileExtensions": "6.0.0", + "Microsoft.Extensions.Configuration.Json": "6.0.0", + "Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", + "Microsoft.Extensions.DependencyInjection": "6.0.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "Microsoft.Extensions.FileProviders.Abstractions": "6.0.0", + "Microsoft.Extensions.FileProviders.Physical": "6.0.0", + "Microsoft.Extensions.Hosting.Abstractions": "6.0.0", + "Microsoft.Extensions.Logging": "6.0.0", + "Microsoft.Extensions.Logging.Abstractions": "6.0.1", + "Microsoft.Extensions.Logging.Configuration": "6.0.0", + "Microsoft.Extensions.Logging.Console": "6.0.0", + "Microsoft.Extensions.Logging.Debug": "6.0.0", + "Microsoft.Extensions.Logging.EventLog": "6.0.0", + "Microsoft.Extensions.Logging.EventSource": "6.0.0", + "Microsoft.Extensions.Options": "6.0.0" + }, + "runtime": { + "lib/net6.0/Microsoft.Extensions.Hosting.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.222.6406" + } + } + }, + "Microsoft.Extensions.Hosting.Abstractions/6.0.0": { + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "6.0.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "Microsoft.Extensions.FileProviders.Abstractions": "6.0.0" + }, + "runtime": { + "lib/netstandard2.1/Microsoft.Extensions.Hosting.Abstractions.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, "Microsoft.Extensions.Http/6.0.0": { "dependencies": { "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", @@ -393,6 +615,85 @@ } } }, + "Microsoft.Extensions.Logging.Configuration/6.0.0": { + "dependencies": { + "Microsoft.Extensions.Configuration": "6.0.0", + "Microsoft.Extensions.Configuration.Abstractions": "6.0.0", + "Microsoft.Extensions.Configuration.Binder": "6.0.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "Microsoft.Extensions.Logging": "6.0.0", + "Microsoft.Extensions.Logging.Abstractions": "6.0.1", + "Microsoft.Extensions.Options": "6.0.0", + "Microsoft.Extensions.Options.ConfigurationExtensions": "6.0.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Extensions.Logging.Configuration.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, + "Microsoft.Extensions.Logging.Console/6.0.0": { + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "Microsoft.Extensions.Logging": "6.0.0", + "Microsoft.Extensions.Logging.Abstractions": "6.0.1", + "Microsoft.Extensions.Logging.Configuration": "6.0.0", + "Microsoft.Extensions.Options": "6.0.0", + "System.Text.Json": "6.0.2" + }, + "runtime": { + "lib/net6.0/Microsoft.Extensions.Logging.Console.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, + "Microsoft.Extensions.Logging.Debug/6.0.0": { + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "Microsoft.Extensions.Logging": "6.0.0", + "Microsoft.Extensions.Logging.Abstractions": "6.0.1" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Extensions.Logging.Debug.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, + "Microsoft.Extensions.Logging.EventLog/6.0.0": { + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "Microsoft.Extensions.Logging": "6.0.0", + "Microsoft.Extensions.Logging.Abstractions": "6.0.1", + "Microsoft.Extensions.Options": "6.0.0", + "System.Diagnostics.EventLog": "6.0.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Extensions.Logging.EventLog.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, + "Microsoft.Extensions.Logging.EventSource/6.0.0": { + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "Microsoft.Extensions.Logging": "6.0.0", + "Microsoft.Extensions.Logging.Abstractions": "6.0.1", + "Microsoft.Extensions.Options": "6.0.0", + "Microsoft.Extensions.Primitives": "6.0.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Text.Json": "6.0.2" + }, + "runtime": { + "lib/net6.0/Microsoft.Extensions.Logging.EventSource.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, "Microsoft.Extensions.ObjectPool/5.0.10": { "runtime": { "lib/net5.0/Microsoft.Extensions.ObjectPool.dll": { @@ -413,6 +714,21 @@ } } }, + "Microsoft.Extensions.Options.ConfigurationExtensions/6.0.0": { + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "6.0.0", + "Microsoft.Extensions.Configuration.Binder": "6.0.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "Microsoft.Extensions.Options": "6.0.0", + "Microsoft.Extensions.Primitives": "6.0.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Extensions.Options.ConfigurationExtensions.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, "Microsoft.Extensions.Primitives/6.0.0": { "dependencies": { "System.Runtime.CompilerServices.Unsafe": "6.0.0" @@ -942,6 +1258,28 @@ "System.Runtime.CompilerServices.Unsafe": "6.0.0" } }, + "System.Diagnostics.EventLog/6.0.0": { + "runtime": { + "lib/net6.0/System.Diagnostics.EventLog.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + }, + "runtimeTargets": { + "runtimes/win/lib/net6.0/System.Diagnostics.EventLog.Messages.dll": { + "rid": "win", + "assetType": "runtime", + "assemblyVersion": "6.0.0.0", + "fileVersion": "0.0.0.0" + }, + "runtimes/win/lib/net6.0/System.Diagnostics.EventLog.dll": { + "rid": "win", + "assetType": "runtime", + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, "System.Diagnostics.Tools/4.3.0": { "dependencies": { "Microsoft.NETCore.Platforms": "2.0.0", @@ -1856,6 +2194,13 @@ "path": "anglesharp/0.14.0", "hashPath": "anglesharp.0.14.0.nupkg.sha512" }, + "Hangfire.Core/1.7.31": { + "type": "package", + "serviceable": true, + "sha512": "sha512-2SthlIUr2NgFMPQteHZ8SRWj9A8MT0fDcT8D2gSZdVlvb+kvj+250hXOJMm2z/eQoCa0pJ0qFyy8Npxa/JfFiA==", + "path": "hangfire.core/1.7.31", + "hashPath": "hangfire.core.1.7.31.nupkg.sha512" + }, "Microsoft.ApplicationInsights/2.16.0": { "type": "package", "serviceable": true, @@ -1996,6 +2341,13 @@ "path": "microsoft.extensions.caching.memory/6.0.0", "hashPath": "microsoft.extensions.caching.memory.6.0.0.nupkg.sha512" }, + "Microsoft.Extensions.Configuration/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-tq2wXyh3fL17EMF2bXgRhU7JrbO3on93MRKYxzz4JzzvuGSA1l0W3GI9/tl8EO89TH+KWEymP7bcFway6z9fXg==", + "path": "microsoft.extensions.configuration/6.0.0", + "hashPath": "microsoft.extensions.configuration.6.0.0.nupkg.sha512" + }, "Microsoft.Extensions.Configuration.Abstractions/6.0.0": { "type": "package", "serviceable": true, @@ -2003,6 +2355,48 @@ "path": "microsoft.extensions.configuration.abstractions/6.0.0", "hashPath": "microsoft.extensions.configuration.abstractions.6.0.0.nupkg.sha512" }, + "Microsoft.Extensions.Configuration.Binder/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-b3ErKzND8LIC7o08QAVlKfaEIYEvLJbtmVbFZVBRXeu9YkKfSSzLZfR1SUfQPBIy9mKLhEtJgGYImkcMNaKE0A==", + "path": "microsoft.extensions.configuration.binder/6.0.0", + "hashPath": "microsoft.extensions.configuration.binder.6.0.0.nupkg.sha512" + }, + "Microsoft.Extensions.Configuration.CommandLine/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3nL1qCkZ1Oxx14ZTzgo4MmlO7tso7F+TtMZAY2jUAtTLyAcDp+EDjk3RqafoKiNaePyPvvlleEcBxh3b2Hzl1g==", + "path": "microsoft.extensions.configuration.commandline/6.0.0", + "hashPath": "microsoft.extensions.configuration.commandline.6.0.0.nupkg.sha512" + }, + "Microsoft.Extensions.Configuration.EnvironmentVariables/6.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-pnyXV1LFOsYjGveuC07xp0YHIyGq7jRq5Ncb5zrrIieMLWVwgMyYxcOH0jTnBedDT4Gh1QinSqsjqzcieHk1og==", + "path": "microsoft.extensions.configuration.environmentvariables/6.0.1", + "hashPath": "microsoft.extensions.configuration.environmentvariables.6.0.1.nupkg.sha512" + }, + "Microsoft.Extensions.Configuration.FileExtensions/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-V4Dth2cYMZpw3HhGw9XUDIijpI6gN+22LDt0AhufIgOppCUfpWX4483OmN+dFXRJkJLc8Tv0Q8QK+1ingT2+KQ==", + "path": "microsoft.extensions.configuration.fileextensions/6.0.0", + "hashPath": "microsoft.extensions.configuration.fileextensions.6.0.0.nupkg.sha512" + }, + "Microsoft.Extensions.Configuration.Json/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GJGery6QytCzS/BxJ96klgG9in3uH26KcUBbiVG/coNDXCRq6LGVVlUT4vXq34KPuM+R2av+LeYdX9h4IZOCUg==", + "path": "microsoft.extensions.configuration.json/6.0.0", + "hashPath": "microsoft.extensions.configuration.json.6.0.0.nupkg.sha512" + }, + "Microsoft.Extensions.Configuration.UserSecrets/6.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Fy8yr4V6obi7ZxvKYI1i85jqtwMq8tqyxQVZpRSkgeA8enqy/KvBIMdcuNdznlxQMZa72mvbHqb7vbg4Pyx95w==", + "path": "microsoft.extensions.configuration.usersecrets/6.0.1", + "hashPath": "microsoft.extensions.configuration.usersecrets.6.0.1.nupkg.sha512" + }, "Microsoft.Extensions.DependencyInjection/6.0.0": { "type": "package", "serviceable": true, @@ -2017,6 +2411,41 @@ "path": "microsoft.extensions.dependencyinjection.abstractions/6.0.0", "hashPath": "microsoft.extensions.dependencyinjection.abstractions.6.0.0.nupkg.sha512" }, + "Microsoft.Extensions.FileProviders.Abstractions/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-0pd4/fho0gC12rQswaGQxbU34jOS1TPS8lZPpkFCH68ppQjHNHYle9iRuHeev1LhrJ94YPvzcRd8UmIuFk23Qw==", + "path": "microsoft.extensions.fileproviders.abstractions/6.0.0", + "hashPath": "microsoft.extensions.fileproviders.abstractions.6.0.0.nupkg.sha512" + }, + "Microsoft.Extensions.FileProviders.Physical/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-QvkL7l0nM8udt3gfyu0Vw8bbCXblxaKOl7c2oBfgGy4LCURRaL9XWZX1FWJrQc43oMokVneVxH38iz+bY1sbhg==", + "path": "microsoft.extensions.fileproviders.physical/6.0.0", + "hashPath": "microsoft.extensions.fileproviders.physical.6.0.0.nupkg.sha512" + }, + "Microsoft.Extensions.FileSystemGlobbing/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ip8jnL1aPiaPeKINCqaTEbvBFDmVx9dXQEBZ2HOBRXPD1eabGNqP/bKlsIcp7U2lGxiXd5xIhoFcmY8nM4Hdiw==", + "path": "microsoft.extensions.filesystemglobbing/6.0.0", + "hashPath": "microsoft.extensions.filesystemglobbing.6.0.0.nupkg.sha512" + }, + "Microsoft.Extensions.Hosting/6.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-hbmizc9KPWOacLU8Z8YMaBG6KWdZFppczYV/KwnPGU/8xebWxQxdDeJmLOgg968prb7g2oQgnp6JVLX6lgby8g==", + "path": "microsoft.extensions.hosting/6.0.1", + "hashPath": "microsoft.extensions.hosting.6.0.1.nupkg.sha512" + }, + "Microsoft.Extensions.Hosting.Abstractions/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GcT5l2CYXL6Sa27KCSh0TixsRfADUgth+ojQSD5EkzisZxmGFh7CwzkcYuGwvmXLjr27uWRNrJ2vuuEjMhU05Q==", + "path": "microsoft.extensions.hosting.abstractions/6.0.0", + "hashPath": "microsoft.extensions.hosting.abstractions.6.0.0.nupkg.sha512" + }, "Microsoft.Extensions.Http/6.0.0": { "type": "package", "serviceable": true, @@ -2038,6 +2467,41 @@ "path": "microsoft.extensions.logging.abstractions/6.0.1", "hashPath": "microsoft.extensions.logging.abstractions.6.0.1.nupkg.sha512" }, + "Microsoft.Extensions.Logging.Configuration/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZDskjagmBAbv+K8rYW9VhjPplhbOE63xUD0DiuydZJwt15dRyoqicYklLd86zzeintUc7AptDkHn+YhhYkYo8A==", + "path": "microsoft.extensions.logging.configuration/6.0.0", + "hashPath": "microsoft.extensions.logging.configuration.6.0.0.nupkg.sha512" + }, + "Microsoft.Extensions.Logging.Console/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-gsqKzOEdsvq28QiXFxagmn1oRB9GeI5GgYCkoybZtQA0IUb7QPwf1WmN3AwJeNIsadTvIFQCiVK0OVIgKfOBGg==", + "path": "microsoft.extensions.logging.console/6.0.0", + "hashPath": "microsoft.extensions.logging.console.6.0.0.nupkg.sha512" + }, + "Microsoft.Extensions.Logging.Debug/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-M9g/JixseSZATJE9tcMn9uzoD4+DbSglivFqVx8YkRJ7VVPmnvCEbOZ0AAaxsL1EKyI4cz07DXOOJExxNsUOHw==", + "path": "microsoft.extensions.logging.debug/6.0.0", + "hashPath": "microsoft.extensions.logging.debug.6.0.0.nupkg.sha512" + }, + "Microsoft.Extensions.Logging.EventLog/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rlo0RxlMd0WtLG3CHI0qOTp6fFn7MvQjlrCjucA31RqmiMFCZkF8CHNbe8O7tbBIyyoLGWB1he9CbaA5iyHthg==", + "path": "microsoft.extensions.logging.eventlog/6.0.0", + "hashPath": "microsoft.extensions.logging.eventlog.6.0.0.nupkg.sha512" + }, + "Microsoft.Extensions.Logging.EventSource/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BeDyyqt7nkm/nr+Gdk+L8n1tUT/u33VkbXAOesgYSNsxDM9hJ1NOBGoZfj9rCbeD2+9myElI6JOVVFmnzgeWQA==", + "path": "microsoft.extensions.logging.eventsource/6.0.0", + "hashPath": "microsoft.extensions.logging.eventsource.6.0.0.nupkg.sha512" + }, "Microsoft.Extensions.ObjectPool/5.0.10": { "type": "package", "serviceable": true, @@ -2052,6 +2516,13 @@ "path": "microsoft.extensions.options/6.0.0", "hashPath": "microsoft.extensions.options.6.0.0.nupkg.sha512" }, + "Microsoft.Extensions.Options.ConfigurationExtensions/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bXWINbTn0vC0FYc9GaQTISbxhQLAMrvtbuvD9N6JelEaIS/Pr62wUCinrq5bf1WRBGczt1v4wDhxFtVFNcMdUQ==", + "path": "microsoft.extensions.options.configurationextensions/6.0.0", + "hashPath": "microsoft.extensions.options.configurationextensions.6.0.0.nupkg.sha512" + }, "Microsoft.Extensions.Primitives/6.0.0": { "type": "package", "serviceable": true, @@ -2416,6 +2887,13 @@ "path": "system.diagnostics.diagnosticsource/6.0.0", "hashPath": "system.diagnostics.diagnosticsource.6.0.0.nupkg.sha512" }, + "System.Diagnostics.EventLog/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-lcyUiXTsETK2ALsZrX+nWuHSIQeazhqPphLfaRxzdGaG93+0kELqpgEHtwWOlQe7+jSFnKwaCAgL4kjeZCQJnw==", + "path": "system.diagnostics.eventlog/6.0.0", + "hashPath": "system.diagnostics.eventlog.6.0.0.nupkg.sha512" + }, "System.Diagnostics.Tools/4.3.0": { "type": "package", "serviceable": true, diff --git a/console_spo_utils/console_spo_utils.csproj b/console_spo_utils/console_spo_utils.csproj index 3d3d6e4..ff77266 100644 --- a/console_spo_utils/console_spo_utils.csproj +++ b/console_spo_utils/console_spo_utils.csproj @@ -4,11 +4,14 @@ Exe net6.0 enable - enable + disable + + + @@ -19,4 +22,10 @@ + + + + + + diff --git a/console_spo_utils/obj/Debug/net6.0/console_spo_utils.csproj.FileListAbsolute.txt b/console_spo_utils/obj/Debug/net6.0/console_spo_utils.csproj.FileListAbsolute.txt index b5282c5..0a518d7 100644 --- a/console_spo_utils/obj/Debug/net6.0/console_spo_utils.csproj.FileListAbsolute.txt +++ b/console_spo_utils/obj/Debug/net6.0/console_spo_utils.csproj.FileListAbsolute.txt @@ -154,3 +154,38 @@ C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\runtimes\unix C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\runtimes\win\lib\net6.0\System.Drawing.Common.dll C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\runtimes\win\lib\net6.0\System.Security.Cryptography.ProtectedData.dll C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\runtimes\win\lib\net6.0\System.Windows.Extensions.dll +C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\Hangfire.Core.dll +C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\Microsoft.Extensions.Configuration.dll +C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\Microsoft.Extensions.Configuration.Binder.dll +C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\Microsoft.Extensions.Configuration.CommandLine.dll +C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\Microsoft.Extensions.Configuration.EnvironmentVariables.dll +C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\Microsoft.Extensions.Configuration.FileExtensions.dll +C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\Microsoft.Extensions.Configuration.Json.dll +C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\Microsoft.Extensions.Configuration.UserSecrets.dll +C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\Microsoft.Extensions.FileProviders.Abstractions.dll +C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\Microsoft.Extensions.FileProviders.Physical.dll +C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\Microsoft.Extensions.FileSystemGlobbing.dll +C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\Microsoft.Extensions.Hosting.dll +C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\Microsoft.Extensions.Hosting.Abstractions.dll +C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\Microsoft.Extensions.Logging.Configuration.dll +C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\Microsoft.Extensions.Logging.Console.dll +C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\Microsoft.Extensions.Logging.Debug.dll +C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\Microsoft.Extensions.Logging.EventLog.dll +C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\Microsoft.Extensions.Logging.EventSource.dll +C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\Microsoft.Extensions.Options.ConfigurationExtensions.dll +C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\System.Diagnostics.EventLog.dll +C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\ca\Hangfire.Core.resources.dll +C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\de\Hangfire.Core.resources.dll +C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\es\Hangfire.Core.resources.dll +C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\fa\Hangfire.Core.resources.dll +C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\fr\Hangfire.Core.resources.dll +C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\nb\Hangfire.Core.resources.dll +C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\nl\Hangfire.Core.resources.dll +C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\pt-BR\Hangfire.Core.resources.dll +C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\pt-PT\Hangfire.Core.resources.dll +C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\pt\Hangfire.Core.resources.dll +C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\tr-TR\Hangfire.Core.resources.dll +C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\zh-TW\Hangfire.Core.resources.dll +C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\zh\Hangfire.Core.resources.dll +C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\runtimes\win\lib\net6.0\System.Diagnostics.EventLog.Messages.dll +C:\Sources\VS\console_spo_utils\console_spo_utils\bin\Debug\net6.0\runtimes\win\lib\net6.0\System.Diagnostics.EventLog.dll diff --git a/console_spo_utils/obj/console_spo_utils.csproj.nuget.dgspec.json b/console_spo_utils/obj/console_spo_utils.csproj.nuget.dgspec.json index 006f820..bc24458 100644 --- a/console_spo_utils/obj/console_spo_utils.csproj.nuget.dgspec.json +++ b/console_spo_utils/obj/console_spo_utils.csproj.nuget.dgspec.json @@ -48,10 +48,22 @@ "net6.0": { "targetAlias": "net6.0", "dependencies": { + "Hangfire.Core": { + "target": "Package", + "version": "[1.7.31, )" + }, "Microsoft.AspNetCore.Components.WebAssembly.Authentication": { "target": "Package", "version": "[6.0.8, )" }, + "Microsoft.Extensions.Hosting": { + "target": "Package", + "version": "[6.0.1, )" + }, + "Microsoft.Extensions.Hosting.Abstractions": { + "target": "Package", + "version": "[6.0.0, )" + }, "Microsoft.PowerPlatform.Dataverse.Client": { "target": "Package", "version": "[1.0.9, )" diff --git a/console_spo_utils/obj/console_spo_utils.csproj.nuget.g.props b/console_spo_utils/obj/console_spo_utils.csproj.nuget.g.props index 029aadf..6da8d3f 100644 --- a/console_spo_utils/obj/console_spo_utils.csproj.nuget.g.props +++ b/console_spo_utils/obj/console_spo_utils.csproj.nuget.g.props @@ -15,6 +15,7 @@ + \ No newline at end of file diff --git a/console_spo_utils/obj/console_spo_utils.csproj.nuget.g.targets b/console_spo_utils/obj/console_spo_utils.csproj.nuget.g.targets index 1908944..73b4c7c 100644 --- a/console_spo_utils/obj/console_spo_utils.csproj.nuget.g.targets +++ b/console_spo_utils/obj/console_spo_utils.csproj.nuget.g.targets @@ -2,6 +2,7 @@ + \ No newline at end of file diff --git a/console_spo_utils/obj/project.assets.json b/console_spo_utils/obj/project.assets.json index b5b5f56..41c5721 100644 --- a/console_spo_utils/obj/project.assets.json +++ b/console_spo_utils/obj/project.assets.json @@ -18,6 +18,63 @@ } } }, + "Hangfire.Core/1.7.31": { + "type": "package", + "dependencies": { + "Newtonsoft.Json": "11.0.1" + }, + "compile": { + "lib/netstandard2.0/Hangfire.Core.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/Hangfire.Core.dll": { + "related": ".xml" + } + }, + "resource": { + "lib/netstandard2.0/ca/Hangfire.Core.resources.dll": { + "locale": "ca" + }, + "lib/netstandard2.0/de/Hangfire.Core.resources.dll": { + "locale": "de" + }, + "lib/netstandard2.0/es/Hangfire.Core.resources.dll": { + "locale": "es" + }, + "lib/netstandard2.0/fa/Hangfire.Core.resources.dll": { + "locale": "fa" + }, + "lib/netstandard2.0/fr/Hangfire.Core.resources.dll": { + "locale": "fr" + }, + "lib/netstandard2.0/nb/Hangfire.Core.resources.dll": { + "locale": "nb" + }, + "lib/netstandard2.0/nl/Hangfire.Core.resources.dll": { + "locale": "nl" + }, + "lib/netstandard2.0/pt-BR/Hangfire.Core.resources.dll": { + "locale": "pt-BR" + }, + "lib/netstandard2.0/pt-PT/Hangfire.Core.resources.dll": { + "locale": "pt-PT" + }, + "lib/netstandard2.0/pt/Hangfire.Core.resources.dll": { + "locale": "pt" + }, + "lib/netstandard2.0/tr-TR/Hangfire.Core.resources.dll": { + "locale": "tr-TR" + }, + "lib/netstandard2.0/zh-TW/Hangfire.Core.resources.dll": { + "locale": "zh-TW" + }, + "lib/netstandard2.0/zh/Hangfire.Core.resources.dll": { + "locale": "zh" + } + } + }, "Microsoft.ApplicationInsights/2.16.0": { "type": "package", "dependencies": { @@ -415,6 +472,23 @@ } } }, + "Microsoft.Extensions.Configuration/6.0.0": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "6.0.0", + "Microsoft.Extensions.Primitives": "6.0.0" + }, + "compile": { + "lib/netstandard2.0/Microsoft.Extensions.Configuration.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Extensions.Configuration.dll": { + "related": ".xml" + } + } + }, "Microsoft.Extensions.Configuration.Abstractions/6.0.0": { "type": "package", "dependencies": { @@ -431,6 +505,119 @@ } } }, + "Microsoft.Extensions.Configuration.Binder/6.0.0": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "6.0.0" + }, + "compile": { + "lib/netstandard2.0/Microsoft.Extensions.Configuration.Binder.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Extensions.Configuration.Binder.dll": { + "related": ".xml" + } + } + }, + "Microsoft.Extensions.Configuration.CommandLine/6.0.0": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.Configuration": "6.0.0", + "Microsoft.Extensions.Configuration.Abstractions": "6.0.0" + }, + "compile": { + "lib/netstandard2.0/Microsoft.Extensions.Configuration.CommandLine.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Extensions.Configuration.CommandLine.dll": { + "related": ".xml" + } + } + }, + "Microsoft.Extensions.Configuration.EnvironmentVariables/6.0.1": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.Configuration": "6.0.0", + "Microsoft.Extensions.Configuration.Abstractions": "6.0.0" + }, + "compile": { + "lib/netstandard2.0/Microsoft.Extensions.Configuration.EnvironmentVariables.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Extensions.Configuration.EnvironmentVariables.dll": { + "related": ".xml" + } + } + }, + "Microsoft.Extensions.Configuration.FileExtensions/6.0.0": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.Configuration": "6.0.0", + "Microsoft.Extensions.Configuration.Abstractions": "6.0.0", + "Microsoft.Extensions.FileProviders.Abstractions": "6.0.0", + "Microsoft.Extensions.FileProviders.Physical": "6.0.0", + "Microsoft.Extensions.Primitives": "6.0.0" + }, + "compile": { + "lib/netstandard2.0/Microsoft.Extensions.Configuration.FileExtensions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Extensions.Configuration.FileExtensions.dll": { + "related": ".xml" + } + } + }, + "Microsoft.Extensions.Configuration.Json/6.0.0": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.Configuration": "6.0.0", + "Microsoft.Extensions.Configuration.Abstractions": "6.0.0", + "Microsoft.Extensions.Configuration.FileExtensions": "6.0.0", + "Microsoft.Extensions.FileProviders.Abstractions": "6.0.0", + "System.Text.Json": "6.0.0" + }, + "compile": { + "lib/netstandard2.1/Microsoft.Extensions.Configuration.Json.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.1/Microsoft.Extensions.Configuration.Json.dll": { + "related": ".xml" + } + } + }, + "Microsoft.Extensions.Configuration.UserSecrets/6.0.1": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "6.0.0", + "Microsoft.Extensions.Configuration.Json": "6.0.0", + "Microsoft.Extensions.FileProviders.Abstractions": "6.0.0", + "Microsoft.Extensions.FileProviders.Physical": "6.0.0" + }, + "compile": { + "lib/netstandard2.0/Microsoft.Extensions.Configuration.UserSecrets.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Extensions.Configuration.UserSecrets.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/netstandard2.0/Microsoft.Extensions.Configuration.UserSecrets.props": {}, + "buildTransitive/netstandard2.0/Microsoft.Extensions.Configuration.UserSecrets.targets": {} + } + }, "Microsoft.Extensions.DependencyInjection/6.0.0": { "type": "package", "dependencies": { @@ -467,6 +654,119 @@ "buildTransitive/netcoreapp3.1/_._": {} } }, + "Microsoft.Extensions.FileProviders.Abstractions/6.0.0": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.Primitives": "6.0.0" + }, + "compile": { + "lib/net6.0/Microsoft.Extensions.FileProviders.Abstractions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/Microsoft.Extensions.FileProviders.Abstractions.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/netcoreapp3.1/_._": {} + } + }, + "Microsoft.Extensions.FileProviders.Physical/6.0.0": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.FileProviders.Abstractions": "6.0.0", + "Microsoft.Extensions.FileSystemGlobbing": "6.0.0", + "Microsoft.Extensions.Primitives": "6.0.0" + }, + "compile": { + "lib/net6.0/Microsoft.Extensions.FileProviders.Physical.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/Microsoft.Extensions.FileProviders.Physical.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/netcoreapp3.1/_._": {} + } + }, + "Microsoft.Extensions.FileSystemGlobbing/6.0.0": { + "type": "package", + "compile": { + "lib/net6.0/Microsoft.Extensions.FileSystemGlobbing.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/Microsoft.Extensions.FileSystemGlobbing.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/netcoreapp3.1/_._": {} + } + }, + "Microsoft.Extensions.Hosting/6.0.1": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.Configuration": "6.0.0", + "Microsoft.Extensions.Configuration.Abstractions": "6.0.0", + "Microsoft.Extensions.Configuration.Binder": "6.0.0", + "Microsoft.Extensions.Configuration.CommandLine": "6.0.0", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", + "Microsoft.Extensions.Configuration.FileExtensions": "6.0.0", + "Microsoft.Extensions.Configuration.Json": "6.0.0", + "Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", + "Microsoft.Extensions.DependencyInjection": "6.0.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "Microsoft.Extensions.FileProviders.Abstractions": "6.0.0", + "Microsoft.Extensions.FileProviders.Physical": "6.0.0", + "Microsoft.Extensions.Hosting.Abstractions": "6.0.0", + "Microsoft.Extensions.Logging": "6.0.0", + "Microsoft.Extensions.Logging.Abstractions": "6.0.0", + "Microsoft.Extensions.Logging.Configuration": "6.0.0", + "Microsoft.Extensions.Logging.Console": "6.0.0", + "Microsoft.Extensions.Logging.Debug": "6.0.0", + "Microsoft.Extensions.Logging.EventLog": "6.0.0", + "Microsoft.Extensions.Logging.EventSource": "6.0.0", + "Microsoft.Extensions.Options": "6.0.0" + }, + "compile": { + "lib/net6.0/Microsoft.Extensions.Hosting.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/Microsoft.Extensions.Hosting.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/netcoreapp3.1/_._": {} + } + }, + "Microsoft.Extensions.Hosting.Abstractions/6.0.0": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "6.0.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "Microsoft.Extensions.FileProviders.Abstractions": "6.0.0" + }, + "compile": { + "lib/netstandard2.1/Microsoft.Extensions.Hosting.Abstractions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.1/Microsoft.Extensions.Hosting.Abstractions.dll": { + "related": ".xml" + } + } + }, "Microsoft.Extensions.Http/6.0.0": { "type": "package", "dependencies": { @@ -522,6 +822,116 @@ "buildTransitive/netcoreapp3.1/_._": {} } }, + "Microsoft.Extensions.Logging.Configuration/6.0.0": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.Configuration": "6.0.0", + "Microsoft.Extensions.Configuration.Abstractions": "6.0.0", + "Microsoft.Extensions.Configuration.Binder": "6.0.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "Microsoft.Extensions.Logging": "6.0.0", + "Microsoft.Extensions.Logging.Abstractions": "6.0.0", + "Microsoft.Extensions.Options": "6.0.0", + "Microsoft.Extensions.Options.ConfigurationExtensions": "6.0.0" + }, + "compile": { + "lib/netstandard2.0/Microsoft.Extensions.Logging.Configuration.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Extensions.Logging.Configuration.dll": { + "related": ".xml" + } + } + }, + "Microsoft.Extensions.Logging.Console/6.0.0": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "Microsoft.Extensions.Logging": "6.0.0", + "Microsoft.Extensions.Logging.Abstractions": "6.0.0", + "Microsoft.Extensions.Logging.Configuration": "6.0.0", + "Microsoft.Extensions.Options": "6.0.0", + "System.Text.Json": "6.0.0" + }, + "compile": { + "lib/net6.0/Microsoft.Extensions.Logging.Console.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/Microsoft.Extensions.Logging.Console.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/netcoreapp3.1/_._": {} + } + }, + "Microsoft.Extensions.Logging.Debug/6.0.0": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "Microsoft.Extensions.Logging": "6.0.0", + "Microsoft.Extensions.Logging.Abstractions": "6.0.0" + }, + "compile": { + "lib/netstandard2.0/Microsoft.Extensions.Logging.Debug.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Extensions.Logging.Debug.dll": { + "related": ".xml" + } + } + }, + "Microsoft.Extensions.Logging.EventLog/6.0.0": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "Microsoft.Extensions.Logging": "6.0.0", + "Microsoft.Extensions.Logging.Abstractions": "6.0.0", + "Microsoft.Extensions.Options": "6.0.0", + "System.Diagnostics.EventLog": "6.0.0" + }, + "compile": { + "lib/netstandard2.0/Microsoft.Extensions.Logging.EventLog.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Extensions.Logging.EventLog.dll": { + "related": ".xml" + } + } + }, + "Microsoft.Extensions.Logging.EventSource/6.0.0": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "Microsoft.Extensions.Logging": "6.0.0", + "Microsoft.Extensions.Logging.Abstractions": "6.0.0", + "Microsoft.Extensions.Options": "6.0.0", + "Microsoft.Extensions.Primitives": "6.0.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Text.Json": "6.0.0" + }, + "compile": { + "lib/net6.0/Microsoft.Extensions.Logging.EventSource.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/Microsoft.Extensions.Logging.EventSource.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/netcoreapp3.1/_._": {} + } + }, "Microsoft.Extensions.ObjectPool/5.0.10": { "type": "package", "compile": { @@ -552,6 +962,26 @@ } } }, + "Microsoft.Extensions.Options.ConfigurationExtensions/6.0.0": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "6.0.0", + "Microsoft.Extensions.Configuration.Binder": "6.0.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "Microsoft.Extensions.Options": "6.0.0", + "Microsoft.Extensions.Primitives": "6.0.0" + }, + "compile": { + "lib/netstandard2.0/Microsoft.Extensions.Options.ConfigurationExtensions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Extensions.Options.ConfigurationExtensions.dll": { + "related": ".xml" + } + } + }, "Microsoft.Extensions.Primitives/6.0.0": { "type": "package", "dependencies": { @@ -1384,6 +1814,32 @@ "buildTransitive/netcoreapp3.1/_._": {} } }, + "System.Diagnostics.EventLog/6.0.0": { + "type": "package", + "compile": { + "lib/net6.0/System.Diagnostics.EventLog.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/System.Diagnostics.EventLog.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/netcoreapp3.1/_._": {} + }, + "runtimeTargets": { + "runtimes/win/lib/net6.0/System.Diagnostics.EventLog.Messages.dll": { + "assetType": "runtime", + "rid": "win" + }, + "runtimes/win/lib/net6.0/System.Diagnostics.EventLog.dll": { + "assetType": "runtime", + "rid": "win" + } + } + }, "System.Diagnostics.Tools/4.3.0": { "type": "package", "dependencies": { @@ -2980,6 +3436,83 @@ "lib/netstandard2.0/AngleSharp.xml" ] }, + "Hangfire.Core/1.7.31": { + "sha512": "2SthlIUr2NgFMPQteHZ8SRWj9A8MT0fDcT8D2gSZdVlvb+kvj+250hXOJMm2z/eQoCa0pJ0qFyy8Npxa/JfFiA==", + "type": "package", + "path": "hangfire.core/1.7.31", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "COPYING", + "COPYING.LESSER", + "LICENSE.md", + "LICENSE_ROYALTYFREE", + "LICENSE_STANDARD", + "NOTICES", + "hangfire.core.1.7.31.nupkg.sha512", + "hangfire.core.nuspec", + "lib/net45/Hangfire.Core.dll", + "lib/net45/Hangfire.Core.xml", + "lib/net45/ca/Hangfire.Core.resources.dll", + "lib/net45/de/Hangfire.Core.resources.dll", + "lib/net45/es/Hangfire.Core.resources.dll", + "lib/net45/fa/Hangfire.Core.resources.dll", + "lib/net45/fr/Hangfire.Core.resources.dll", + "lib/net45/nb/Hangfire.Core.resources.dll", + "lib/net45/nl/Hangfire.Core.resources.dll", + "lib/net45/pt-BR/Hangfire.Core.resources.dll", + "lib/net45/pt-PT/Hangfire.Core.resources.dll", + "lib/net45/pt/Hangfire.Core.resources.dll", + "lib/net45/tr-TR/Hangfire.Core.resources.dll", + "lib/net45/zh-TW/Hangfire.Core.resources.dll", + "lib/net45/zh/Hangfire.Core.resources.dll", + "lib/net46/Hangfire.Core.dll", + "lib/net46/Hangfire.Core.xml", + "lib/net46/ca/Hangfire.Core.resources.dll", + "lib/net46/de/Hangfire.Core.resources.dll", + "lib/net46/es/Hangfire.Core.resources.dll", + "lib/net46/fa/Hangfire.Core.resources.dll", + "lib/net46/fr/Hangfire.Core.resources.dll", + "lib/net46/nb/Hangfire.Core.resources.dll", + "lib/net46/nl/Hangfire.Core.resources.dll", + "lib/net46/pt-BR/Hangfire.Core.resources.dll", + "lib/net46/pt-PT/Hangfire.Core.resources.dll", + "lib/net46/pt/Hangfire.Core.resources.dll", + "lib/net46/tr-TR/Hangfire.Core.resources.dll", + "lib/net46/zh-TW/Hangfire.Core.resources.dll", + "lib/net46/zh/Hangfire.Core.resources.dll", + "lib/netstandard1.3/Hangfire.Core.dll", + "lib/netstandard1.3/Hangfire.Core.xml", + "lib/netstandard1.3/ca/Hangfire.Core.resources.dll", + "lib/netstandard1.3/de/Hangfire.Core.resources.dll", + "lib/netstandard1.3/es/Hangfire.Core.resources.dll", + "lib/netstandard1.3/fa/Hangfire.Core.resources.dll", + "lib/netstandard1.3/fr/Hangfire.Core.resources.dll", + "lib/netstandard1.3/nb/Hangfire.Core.resources.dll", + "lib/netstandard1.3/nl/Hangfire.Core.resources.dll", + "lib/netstandard1.3/pt-BR/Hangfire.Core.resources.dll", + "lib/netstandard1.3/pt-PT/Hangfire.Core.resources.dll", + "lib/netstandard1.3/pt/Hangfire.Core.resources.dll", + "lib/netstandard1.3/tr-TR/Hangfire.Core.resources.dll", + "lib/netstandard1.3/zh-TW/Hangfire.Core.resources.dll", + "lib/netstandard1.3/zh/Hangfire.Core.resources.dll", + "lib/netstandard2.0/Hangfire.Core.dll", + "lib/netstandard2.0/Hangfire.Core.xml", + "lib/netstandard2.0/ca/Hangfire.Core.resources.dll", + "lib/netstandard2.0/de/Hangfire.Core.resources.dll", + "lib/netstandard2.0/es/Hangfire.Core.resources.dll", + "lib/netstandard2.0/fa/Hangfire.Core.resources.dll", + "lib/netstandard2.0/fr/Hangfire.Core.resources.dll", + "lib/netstandard2.0/nb/Hangfire.Core.resources.dll", + "lib/netstandard2.0/nl/Hangfire.Core.resources.dll", + "lib/netstandard2.0/pt-BR/Hangfire.Core.resources.dll", + "lib/netstandard2.0/pt-PT/Hangfire.Core.resources.dll", + "lib/netstandard2.0/pt/Hangfire.Core.resources.dll", + "lib/netstandard2.0/tr-TR/Hangfire.Core.resources.dll", + "lib/netstandard2.0/zh-TW/Hangfire.Core.resources.dll", + "lib/netstandard2.0/zh/Hangfire.Core.resources.dll" + ] + }, "Microsoft.ApplicationInsights/2.16.0": { "sha512": "77RzjJe9nGn7wTOQvEFQZRdkQjETrbC4MhytzwTv2TTuoqoHvmUIzwFqE6BjjFGsHbZhYNYZg/YJbOa4kUMSSg==", "type": "package", @@ -3495,6 +4028,25 @@ "useSharedDesignerContext.txt" ] }, + "Microsoft.Extensions.Configuration/6.0.0": { + "sha512": "tq2wXyh3fL17EMF2bXgRhU7JrbO3on93MRKYxzz4JzzvuGSA1l0W3GI9/tl8EO89TH+KWEymP7bcFway6z9fXg==", + "type": "package", + "path": "microsoft.extensions.configuration/6.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net461/Microsoft.Extensions.Configuration.dll", + "lib/net461/Microsoft.Extensions.Configuration.xml", + "lib/netstandard2.0/Microsoft.Extensions.Configuration.dll", + "lib/netstandard2.0/Microsoft.Extensions.Configuration.xml", + "microsoft.extensions.configuration.6.0.0.nupkg.sha512", + "microsoft.extensions.configuration.nuspec", + "useSharedDesignerContext.txt" + ] + }, "Microsoft.Extensions.Configuration.Abstractions/6.0.0": { "sha512": "qWzV9o+ZRWq+pGm+1dF+R7qTgTYoXvbyowRoBxQJGfqTpqDun2eteerjRQhq5PQ/14S+lqto3Ft4gYaRyl4rdQ==", "type": "package", @@ -3514,6 +4066,124 @@ "useSharedDesignerContext.txt" ] }, + "Microsoft.Extensions.Configuration.Binder/6.0.0": { + "sha512": "b3ErKzND8LIC7o08QAVlKfaEIYEvLJbtmVbFZVBRXeu9YkKfSSzLZfR1SUfQPBIy9mKLhEtJgGYImkcMNaKE0A==", + "type": "package", + "path": "microsoft.extensions.configuration.binder/6.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net461/Microsoft.Extensions.Configuration.Binder.dll", + "lib/net461/Microsoft.Extensions.Configuration.Binder.xml", + "lib/netstandard2.0/Microsoft.Extensions.Configuration.Binder.dll", + "lib/netstandard2.0/Microsoft.Extensions.Configuration.Binder.xml", + "microsoft.extensions.configuration.binder.6.0.0.nupkg.sha512", + "microsoft.extensions.configuration.binder.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "Microsoft.Extensions.Configuration.CommandLine/6.0.0": { + "sha512": "3nL1qCkZ1Oxx14ZTzgo4MmlO7tso7F+TtMZAY2jUAtTLyAcDp+EDjk3RqafoKiNaePyPvvlleEcBxh3b2Hzl1g==", + "type": "package", + "path": "microsoft.extensions.configuration.commandline/6.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net461/Microsoft.Extensions.Configuration.CommandLine.dll", + "lib/net461/Microsoft.Extensions.Configuration.CommandLine.xml", + "lib/netstandard2.0/Microsoft.Extensions.Configuration.CommandLine.dll", + "lib/netstandard2.0/Microsoft.Extensions.Configuration.CommandLine.xml", + "microsoft.extensions.configuration.commandline.6.0.0.nupkg.sha512", + "microsoft.extensions.configuration.commandline.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "Microsoft.Extensions.Configuration.EnvironmentVariables/6.0.1": { + "sha512": "pnyXV1LFOsYjGveuC07xp0YHIyGq7jRq5Ncb5zrrIieMLWVwgMyYxcOH0jTnBedDT4Gh1QinSqsjqzcieHk1og==", + "type": "package", + "path": "microsoft.extensions.configuration.environmentvariables/6.0.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net461/Microsoft.Extensions.Configuration.EnvironmentVariables.dll", + "lib/net461/Microsoft.Extensions.Configuration.EnvironmentVariables.xml", + "lib/netstandard2.0/Microsoft.Extensions.Configuration.EnvironmentVariables.dll", + "lib/netstandard2.0/Microsoft.Extensions.Configuration.EnvironmentVariables.xml", + "microsoft.extensions.configuration.environmentvariables.6.0.1.nupkg.sha512", + "microsoft.extensions.configuration.environmentvariables.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "Microsoft.Extensions.Configuration.FileExtensions/6.0.0": { + "sha512": "V4Dth2cYMZpw3HhGw9XUDIijpI6gN+22LDt0AhufIgOppCUfpWX4483OmN+dFXRJkJLc8Tv0Q8QK+1ingT2+KQ==", + "type": "package", + "path": "microsoft.extensions.configuration.fileextensions/6.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net461/Microsoft.Extensions.Configuration.FileExtensions.dll", + "lib/net461/Microsoft.Extensions.Configuration.FileExtensions.xml", + "lib/netstandard2.0/Microsoft.Extensions.Configuration.FileExtensions.dll", + "lib/netstandard2.0/Microsoft.Extensions.Configuration.FileExtensions.xml", + "microsoft.extensions.configuration.fileextensions.6.0.0.nupkg.sha512", + "microsoft.extensions.configuration.fileextensions.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "Microsoft.Extensions.Configuration.Json/6.0.0": { + "sha512": "GJGery6QytCzS/BxJ96klgG9in3uH26KcUBbiVG/coNDXCRq6LGVVlUT4vXq34KPuM+R2av+LeYdX9h4IZOCUg==", + "type": "package", + "path": "microsoft.extensions.configuration.json/6.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net461/Microsoft.Extensions.Configuration.Json.dll", + "lib/net461/Microsoft.Extensions.Configuration.Json.xml", + "lib/netstandard2.0/Microsoft.Extensions.Configuration.Json.dll", + "lib/netstandard2.0/Microsoft.Extensions.Configuration.Json.xml", + "lib/netstandard2.1/Microsoft.Extensions.Configuration.Json.dll", + "lib/netstandard2.1/Microsoft.Extensions.Configuration.Json.xml", + "microsoft.extensions.configuration.json.6.0.0.nupkg.sha512", + "microsoft.extensions.configuration.json.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "Microsoft.Extensions.Configuration.UserSecrets/6.0.1": { + "sha512": "Fy8yr4V6obi7ZxvKYI1i85jqtwMq8tqyxQVZpRSkgeA8enqy/KvBIMdcuNdznlxQMZa72mvbHqb7vbg4Pyx95w==", + "type": "package", + "path": "microsoft.extensions.configuration.usersecrets/6.0.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/netstandard2.0/Microsoft.Extensions.Configuration.UserSecrets.props", + "buildTransitive/netstandard2.0/Microsoft.Extensions.Configuration.UserSecrets.targets", + "lib/net461/Microsoft.Extensions.Configuration.UserSecrets.dll", + "lib/net461/Microsoft.Extensions.Configuration.UserSecrets.xml", + "lib/netstandard2.0/Microsoft.Extensions.Configuration.UserSecrets.dll", + "lib/netstandard2.0/Microsoft.Extensions.Configuration.UserSecrets.xml", + "microsoft.extensions.configuration.usersecrets.6.0.1.nupkg.sha512", + "microsoft.extensions.configuration.usersecrets.nuspec", + "useSharedDesignerContext.txt" + ] + }, "Microsoft.Extensions.DependencyInjection/6.0.0": { "sha512": "k6PWQMuoBDGGHOQTtyois2u4AwyVcIwL2LaSLlTZQm2CYcJ1pxbt6jfAnpWmzENA/wfrYRI/X9DTLoUkE4AsLw==", "type": "package", @@ -3564,6 +4234,121 @@ "useSharedDesignerContext.txt" ] }, + "Microsoft.Extensions.FileProviders.Abstractions/6.0.0": { + "sha512": "0pd4/fho0gC12rQswaGQxbU34jOS1TPS8lZPpkFCH68ppQjHNHYle9iRuHeev1LhrJ94YPvzcRd8UmIuFk23Qw==", + "type": "package", + "path": "microsoft.extensions.fileproviders.abstractions/6.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/netcoreapp2.0/Microsoft.Extensions.FileProviders.Abstractions.targets", + "buildTransitive/netcoreapp3.1/_._", + "lib/net461/Microsoft.Extensions.FileProviders.Abstractions.dll", + "lib/net461/Microsoft.Extensions.FileProviders.Abstractions.xml", + "lib/net6.0/Microsoft.Extensions.FileProviders.Abstractions.dll", + "lib/net6.0/Microsoft.Extensions.FileProviders.Abstractions.xml", + "lib/netstandard2.0/Microsoft.Extensions.FileProviders.Abstractions.dll", + "lib/netstandard2.0/Microsoft.Extensions.FileProviders.Abstractions.xml", + "microsoft.extensions.fileproviders.abstractions.6.0.0.nupkg.sha512", + "microsoft.extensions.fileproviders.abstractions.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "Microsoft.Extensions.FileProviders.Physical/6.0.0": { + "sha512": "QvkL7l0nM8udt3gfyu0Vw8bbCXblxaKOl7c2oBfgGy4LCURRaL9XWZX1FWJrQc43oMokVneVxH38iz+bY1sbhg==", + "type": "package", + "path": "microsoft.extensions.fileproviders.physical/6.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/netcoreapp2.0/Microsoft.Extensions.FileProviders.Physical.targets", + "buildTransitive/netcoreapp3.1/_._", + "lib/net461/Microsoft.Extensions.FileProviders.Physical.dll", + "lib/net461/Microsoft.Extensions.FileProviders.Physical.xml", + "lib/net6.0/Microsoft.Extensions.FileProviders.Physical.dll", + "lib/net6.0/Microsoft.Extensions.FileProviders.Physical.xml", + "lib/netstandard2.0/Microsoft.Extensions.FileProviders.Physical.dll", + "lib/netstandard2.0/Microsoft.Extensions.FileProviders.Physical.xml", + "microsoft.extensions.fileproviders.physical.6.0.0.nupkg.sha512", + "microsoft.extensions.fileproviders.physical.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "Microsoft.Extensions.FileSystemGlobbing/6.0.0": { + "sha512": "ip8jnL1aPiaPeKINCqaTEbvBFDmVx9dXQEBZ2HOBRXPD1eabGNqP/bKlsIcp7U2lGxiXd5xIhoFcmY8nM4Hdiw==", + "type": "package", + "path": "microsoft.extensions.filesystemglobbing/6.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/netcoreapp2.0/Microsoft.Extensions.FileSystemGlobbing.targets", + "buildTransitive/netcoreapp3.1/_._", + "lib/net461/Microsoft.Extensions.FileSystemGlobbing.dll", + "lib/net461/Microsoft.Extensions.FileSystemGlobbing.xml", + "lib/net6.0/Microsoft.Extensions.FileSystemGlobbing.dll", + "lib/net6.0/Microsoft.Extensions.FileSystemGlobbing.xml", + "lib/netstandard2.0/Microsoft.Extensions.FileSystemGlobbing.dll", + "lib/netstandard2.0/Microsoft.Extensions.FileSystemGlobbing.xml", + "microsoft.extensions.filesystemglobbing.6.0.0.nupkg.sha512", + "microsoft.extensions.filesystemglobbing.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "Microsoft.Extensions.Hosting/6.0.1": { + "sha512": "hbmizc9KPWOacLU8Z8YMaBG6KWdZFppczYV/KwnPGU/8xebWxQxdDeJmLOgg968prb7g2oQgnp6JVLX6lgby8g==", + "type": "package", + "path": "microsoft.extensions.hosting/6.0.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/netcoreapp2.0/Microsoft.Extensions.Hosting.targets", + "buildTransitive/netcoreapp3.1/_._", + "lib/net461/Microsoft.Extensions.Hosting.dll", + "lib/net461/Microsoft.Extensions.Hosting.xml", + "lib/net6.0/Microsoft.Extensions.Hosting.dll", + "lib/net6.0/Microsoft.Extensions.Hosting.xml", + "lib/netstandard2.0/Microsoft.Extensions.Hosting.dll", + "lib/netstandard2.0/Microsoft.Extensions.Hosting.xml", + "lib/netstandard2.1/Microsoft.Extensions.Hosting.dll", + "lib/netstandard2.1/Microsoft.Extensions.Hosting.xml", + "microsoft.extensions.hosting.6.0.1.nupkg.sha512", + "microsoft.extensions.hosting.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "Microsoft.Extensions.Hosting.Abstractions/6.0.0": { + "sha512": "GcT5l2CYXL6Sa27KCSh0TixsRfADUgth+ojQSD5EkzisZxmGFh7CwzkcYuGwvmXLjr27uWRNrJ2vuuEjMhU05Q==", + "type": "package", + "path": "microsoft.extensions.hosting.abstractions/6.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net461/Microsoft.Extensions.Hosting.Abstractions.dll", + "lib/net461/Microsoft.Extensions.Hosting.Abstractions.xml", + "lib/netstandard2.0/Microsoft.Extensions.Hosting.Abstractions.dll", + "lib/netstandard2.0/Microsoft.Extensions.Hosting.Abstractions.xml", + "lib/netstandard2.1/Microsoft.Extensions.Hosting.Abstractions.dll", + "lib/netstandard2.1/Microsoft.Extensions.Hosting.Abstractions.xml", + "microsoft.extensions.hosting.abstractions.6.0.0.nupkg.sha512", + "microsoft.extensions.hosting.abstractions.nuspec", + "useSharedDesignerContext.txt" + ] + }, "Microsoft.Extensions.Http/6.0.0": { "sha512": "15+pa2G0bAMHbHewaQIdr/y6ag2H3yh4rd9hTXavtWDzQBkvpe2RMqFg8BxDpcQWssmjmBApGPcw93QRz6YcMg==", "type": "package", @@ -3656,6 +4441,113 @@ "useSharedDesignerContext.txt" ] }, + "Microsoft.Extensions.Logging.Configuration/6.0.0": { + "sha512": "ZDskjagmBAbv+K8rYW9VhjPplhbOE63xUD0DiuydZJwt15dRyoqicYklLd86zzeintUc7AptDkHn+YhhYkYo8A==", + "type": "package", + "path": "microsoft.extensions.logging.configuration/6.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net461/Microsoft.Extensions.Logging.Configuration.dll", + "lib/net461/Microsoft.Extensions.Logging.Configuration.xml", + "lib/netstandard2.0/Microsoft.Extensions.Logging.Configuration.dll", + "lib/netstandard2.0/Microsoft.Extensions.Logging.Configuration.xml", + "microsoft.extensions.logging.configuration.6.0.0.nupkg.sha512", + "microsoft.extensions.logging.configuration.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "Microsoft.Extensions.Logging.Console/6.0.0": { + "sha512": "gsqKzOEdsvq28QiXFxagmn1oRB9GeI5GgYCkoybZtQA0IUb7QPwf1WmN3AwJeNIsadTvIFQCiVK0OVIgKfOBGg==", + "type": "package", + "path": "microsoft.extensions.logging.console/6.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/netcoreapp2.0/Microsoft.Extensions.Logging.Console.targets", + "buildTransitive/netcoreapp3.1/_._", + "lib/net461/Microsoft.Extensions.Logging.Console.dll", + "lib/net461/Microsoft.Extensions.Logging.Console.xml", + "lib/net6.0/Microsoft.Extensions.Logging.Console.dll", + "lib/net6.0/Microsoft.Extensions.Logging.Console.xml", + "lib/netcoreapp3.1/Microsoft.Extensions.Logging.Console.dll", + "lib/netcoreapp3.1/Microsoft.Extensions.Logging.Console.xml", + "lib/netstandard2.0/Microsoft.Extensions.Logging.Console.dll", + "lib/netstandard2.0/Microsoft.Extensions.Logging.Console.xml", + "microsoft.extensions.logging.console.6.0.0.nupkg.sha512", + "microsoft.extensions.logging.console.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "Microsoft.Extensions.Logging.Debug/6.0.0": { + "sha512": "M9g/JixseSZATJE9tcMn9uzoD4+DbSglivFqVx8YkRJ7VVPmnvCEbOZ0AAaxsL1EKyI4cz07DXOOJExxNsUOHw==", + "type": "package", + "path": "microsoft.extensions.logging.debug/6.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net461/Microsoft.Extensions.Logging.Debug.dll", + "lib/net461/Microsoft.Extensions.Logging.Debug.xml", + "lib/netstandard2.0/Microsoft.Extensions.Logging.Debug.dll", + "lib/netstandard2.0/Microsoft.Extensions.Logging.Debug.xml", + "microsoft.extensions.logging.debug.6.0.0.nupkg.sha512", + "microsoft.extensions.logging.debug.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "Microsoft.Extensions.Logging.EventLog/6.0.0": { + "sha512": "rlo0RxlMd0WtLG3CHI0qOTp6fFn7MvQjlrCjucA31RqmiMFCZkF8CHNbe8O7tbBIyyoLGWB1he9CbaA5iyHthg==", + "type": "package", + "path": "microsoft.extensions.logging.eventlog/6.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net461/Microsoft.Extensions.Logging.EventLog.dll", + "lib/net461/Microsoft.Extensions.Logging.EventLog.xml", + "lib/netstandard2.0/Microsoft.Extensions.Logging.EventLog.dll", + "lib/netstandard2.0/Microsoft.Extensions.Logging.EventLog.xml", + "microsoft.extensions.logging.eventlog.6.0.0.nupkg.sha512", + "microsoft.extensions.logging.eventlog.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "Microsoft.Extensions.Logging.EventSource/6.0.0": { + "sha512": "BeDyyqt7nkm/nr+Gdk+L8n1tUT/u33VkbXAOesgYSNsxDM9hJ1NOBGoZfj9rCbeD2+9myElI6JOVVFmnzgeWQA==", + "type": "package", + "path": "microsoft.extensions.logging.eventsource/6.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/netcoreapp2.0/Microsoft.Extensions.Logging.EventSource.targets", + "buildTransitive/netcoreapp3.1/_._", + "lib/net461/Microsoft.Extensions.Logging.EventSource.dll", + "lib/net461/Microsoft.Extensions.Logging.EventSource.xml", + "lib/net6.0/Microsoft.Extensions.Logging.EventSource.dll", + "lib/net6.0/Microsoft.Extensions.Logging.EventSource.xml", + "lib/netcoreapp3.1/Microsoft.Extensions.Logging.EventSource.dll", + "lib/netcoreapp3.1/Microsoft.Extensions.Logging.EventSource.xml", + "lib/netstandard2.0/Microsoft.Extensions.Logging.EventSource.dll", + "lib/netstandard2.0/Microsoft.Extensions.Logging.EventSource.xml", + "microsoft.extensions.logging.eventsource.6.0.0.nupkg.sha512", + "microsoft.extensions.logging.eventsource.nuspec", + "useSharedDesignerContext.txt" + ] + }, "Microsoft.Extensions.ObjectPool/5.0.10": { "sha512": "pp9tbGqIhdEXL6Q1yJl+zevAJSq4BsxqhS1GXzBvEsEz9DDNu9GLNzgUy2xyFc4YjB4m4Ff2YEWTnvQvVYdkvQ==", "type": "package", @@ -3696,6 +4588,25 @@ "useSharedDesignerContext.txt" ] }, + "Microsoft.Extensions.Options.ConfigurationExtensions/6.0.0": { + "sha512": "bXWINbTn0vC0FYc9GaQTISbxhQLAMrvtbuvD9N6JelEaIS/Pr62wUCinrq5bf1WRBGczt1v4wDhxFtVFNcMdUQ==", + "type": "package", + "path": "microsoft.extensions.options.configurationextensions/6.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net461/Microsoft.Extensions.Options.ConfigurationExtensions.dll", + "lib/net461/Microsoft.Extensions.Options.ConfigurationExtensions.xml", + "lib/netstandard2.0/Microsoft.Extensions.Options.ConfigurationExtensions.dll", + "lib/netstandard2.0/Microsoft.Extensions.Options.ConfigurationExtensions.xml", + "microsoft.extensions.options.configurationextensions.6.0.0.nupkg.sha512", + "microsoft.extensions.options.configurationextensions.nuspec", + "useSharedDesignerContext.txt" + ] + }, "Microsoft.Extensions.Primitives/6.0.0": { "sha512": "9+PnzmQFfEFNR9J2aDTfJGGupShHjOuGw4VUv+JB044biSHrnmCIMD+mJHmb2H7YryrfBEXDurxQ47gJZdCKNQ==", "type": "package", @@ -4939,6 +5850,37 @@ "useSharedDesignerContext.txt" ] }, + "System.Diagnostics.EventLog/6.0.0": { + "sha512": "lcyUiXTsETK2ALsZrX+nWuHSIQeazhqPphLfaRxzdGaG93+0kELqpgEHtwWOlQe7+jSFnKwaCAgL4kjeZCQJnw==", + "type": "package", + "path": "system.diagnostics.eventlog/6.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/netcoreapp2.0/System.Diagnostics.EventLog.targets", + "buildTransitive/netcoreapp3.1/_._", + "lib/net461/System.Diagnostics.EventLog.dll", + "lib/net461/System.Diagnostics.EventLog.xml", + "lib/net6.0/System.Diagnostics.EventLog.dll", + "lib/net6.0/System.Diagnostics.EventLog.xml", + "lib/netcoreapp3.1/System.Diagnostics.EventLog.dll", + "lib/netcoreapp3.1/System.Diagnostics.EventLog.xml", + "lib/netstandard2.0/System.Diagnostics.EventLog.dll", + "lib/netstandard2.0/System.Diagnostics.EventLog.xml", + "runtimes/win/lib/net6.0/System.Diagnostics.EventLog.Messages.dll", + "runtimes/win/lib/net6.0/System.Diagnostics.EventLog.dll", + "runtimes/win/lib/net6.0/System.Diagnostics.EventLog.xml", + "runtimes/win/lib/netcoreapp3.1/System.Diagnostics.EventLog.Messages.dll", + "runtimes/win/lib/netcoreapp3.1/System.Diagnostics.EventLog.dll", + "runtimes/win/lib/netcoreapp3.1/System.Diagnostics.EventLog.xml", + "system.diagnostics.eventlog.6.0.0.nupkg.sha512", + "system.diagnostics.eventlog.nuspec", + "useSharedDesignerContext.txt" + ] + }, "System.Diagnostics.Tools/4.3.0": { "sha512": "UUvkJfSYJMM6x527dJg2VyWPSRqIVB0Z7dbjHst1zmwTXz5CcXSYJFWRpuigfbO1Lf7yfZiIaEUesfnl/g5EyA==", "type": "package", @@ -8914,7 +9856,10 @@ }, "projectFileDependencyGroups": { "net6.0": [ + "Hangfire.Core >= 1.7.31", "Microsoft.AspNetCore.Components.WebAssembly.Authentication >= 6.0.8", + "Microsoft.Extensions.Hosting >= 6.0.1", + "Microsoft.Extensions.Hosting.Abstractions >= 6.0.0", "Microsoft.PowerPlatform.Dataverse.Client >= 1.0.9", "Microsoft.SharePoint.Client >= 14.0.4762.1000", "Microsoft.SharePointOnline.CSOM >= 16.1.22615.12000", @@ -8974,10 +9919,22 @@ "net6.0": { "targetAlias": "net6.0", "dependencies": { + "Hangfire.Core": { + "target": "Package", + "version": "[1.7.31, )" + }, "Microsoft.AspNetCore.Components.WebAssembly.Authentication": { "target": "Package", "version": "[6.0.8, )" }, + "Microsoft.Extensions.Hosting": { + "target": "Package", + "version": "[6.0.1, )" + }, + "Microsoft.Extensions.Hosting.Abstractions": { + "target": "Package", + "version": "[6.0.0, )" + }, "Microsoft.PowerPlatform.Dataverse.Client": { "target": "Package", "version": "[1.0.9, )"