REORG
This commit is contained in:
parent
8d68ee380a
commit
45514010f2
3505 changed files with 154 additions and 523 deletions
|
|
@ -1,19 +0,0 @@
|
|||
using System;
|
||||
|
||||
namespace Yavsc.Attributes
|
||||
{
|
||||
public class ActivityBillingAttribute : Attribute
|
||||
{
|
||||
public string BillingCode { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Identifie une entité de facturation
|
||||
/// </summary>
|
||||
/// <param name="billingCode">Code de facturation,
|
||||
/// Il doit avoir une valeur unique par usage.
|
||||
/// </param>
|
||||
public ActivityBillingAttribute(string billingCode) {
|
||||
BillingCode = billingCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
using System;
|
||||
|
||||
namespace Yavsc.Attributes
|
||||
{
|
||||
public class ActivitySettingsAttribute : Attribute
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Yavsc.Server.Helpers;
|
||||
|
||||
namespace Yavsc.Attributes.Validation
|
||||
{
|
||||
/// <summary>
|
||||
/// Valid Remote User Dir Attribute
|
||||
/// </summary>
|
||||
public class ValidRemoteUserFilePathAttribute : ValidationAttribute
|
||||
{
|
||||
public ValidRemoteUserFilePathAttribute()
|
||||
{
|
||||
UseDefaultErrorMessage();
|
||||
}
|
||||
void UseDefaultErrorMessage()
|
||||
{
|
||||
if (ErrorMessageResourceType==null) {
|
||||
ErrorMessageResourceType = typeof(Yavsc.Attributes.Validation.Resources);
|
||||
ErrorMessageResourceName = "InvalidPath";
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsValid(object value)
|
||||
{
|
||||
if (value == null) return true;
|
||||
var str = (string) value;
|
||||
return str.IsValidYavscPath();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Yavsc.Attributes.Validation
|
||||
{
|
||||
public class YaRegularExpression : System.ComponentModel.DataAnnotations.RegularExpressionAttribute {
|
||||
public YaRegularExpression(string pattern): base (pattern)
|
||||
{
|
||||
this.ErrorMessage = "RegularExpression: "+ pattern;
|
||||
|
||||
}
|
||||
|
||||
public override string FormatErrorMessage(string name)
|
||||
{
|
||||
if (ErrorMessageResourceType==null || string.IsNullOrEmpty(ErrorMessageResourceName))
|
||||
return ErrorMessage;
|
||||
var prop = this.ErrorMessageResourceType.GetProperty(ErrorMessageResourceName);
|
||||
return (string) prop.GetValue(null, BindingFlags.Static, null, null, System.Globalization.CultureInfo.CurrentUICulture);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
using System;
|
||||
|
||||
namespace Yavsc.Attributes.Validation
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)]
|
||||
public class YaRequiredAttribute : YaValidationAttribute
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a flag indicating whether the attribute should allow empty strings.
|
||||
/// </summary>
|
||||
public bool AllowEmptyStrings { get; set; }
|
||||
public YaRequiredAttribute (string msg) : base(msg)
|
||||
{
|
||||
ErrorMessage = msg;
|
||||
}
|
||||
public YaRequiredAttribute () : base("Required Field")
|
||||
{
|
||||
ErrorMessageResourceType = typeof(Yavsc.Attributes.Validation.Resources);
|
||||
ErrorMessageResourceName = "FieldRequired";
|
||||
}
|
||||
|
||||
public override bool IsValid(object value) {
|
||||
if (value == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// only check string length if empty strings are not allowed
|
||||
var stringValue = value as string;
|
||||
if (stringValue != null && !AllowEmptyStrings) {
|
||||
return stringValue.Trim().Length != 0;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
using System;
|
||||
|
||||
namespace Yavsc.Attributes.Validation
|
||||
{
|
||||
public partial class YaStringLength: YaValidationAttribute
|
||||
{
|
||||
public long MinimumLength { get; set; } = 0;
|
||||
private readonly long maxLen;
|
||||
public YaStringLength(long maxLen) : base( ()=> "BadStringLength")
|
||||
{
|
||||
this.maxLen = maxLen;
|
||||
UseDefaultErrorMessage();
|
||||
}
|
||||
public YaStringLength(long minLen, long maxLen) : base( ()=> "BadStringLength")
|
||||
{
|
||||
this.maxLen = maxLen;
|
||||
this.MinimumLength=minLen;
|
||||
UseDefaultErrorMessage();
|
||||
}
|
||||
void UseDefaultErrorMessage()
|
||||
{
|
||||
if (ErrorMessageResourceType==null) {
|
||||
ErrorMessageResourceType = typeof(Yavsc.Attributes.Validation.Resources);
|
||||
ErrorMessageResourceName = "InvalidStringLength";
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsValid(object value) {
|
||||
|
||||
string stringValue = value as string;
|
||||
if (stringValue==null) return MinimumLength <= 0;
|
||||
if (MinimumLength>=0)
|
||||
{
|
||||
if (stringValue.Length< MinimumLength) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (maxLen>=0)
|
||||
{
|
||||
if (stringValue.Length>maxLen) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public override string FormatErrorMessage(string name)
|
||||
{
|
||||
var temp = base.FormatErrorMessage(name);
|
||||
return string.Format(temp, MinimumLength, maxLen);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Yavsc.Attributes.Validation
|
||||
{
|
||||
public class YaValidationAttribute : System.ComponentModel.DataAnnotations.ValidationAttribute
|
||||
{
|
||||
public YaValidationAttribute(string msg) : base(msg)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public YaValidationAttribute(Func<string> acr): base(acr)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get given string from resources
|
||||
/// specified by ErrorMessageResourceType
|
||||
/// </summary>
|
||||
/// <param name="stringName"></param>
|
||||
/// <returns></returns>
|
||||
public virtual string GetResourceString(string stringName)
|
||||
{
|
||||
var prop = this.ErrorMessageResourceType.GetProperty(stringName);
|
||||
if (prop==null)
|
||||
{
|
||||
return " !e! noprop "+stringName+" in "+ErrorMessageResourceType.Name;
|
||||
}
|
||||
else {
|
||||
return (string) prop.GetValue(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
public override string FormatErrorMessage(string name)
|
||||
{
|
||||
if (ErrorMessageResourceType == null) // failed :/
|
||||
{
|
||||
return base.FormatErrorMessage(name);
|
||||
}
|
||||
if (ErrorMessageResourceName == null) // re failed :/
|
||||
return base.FormatErrorMessage(name);
|
||||
|
||||
return GetResourceString(ErrorMessageResourceName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using Yavsc.Attributes.Validation;
|
||||
using Yavsc.Abstract;
|
||||
using Yavsc;
|
||||
|
||||
namespace Yavsc.ViewModels.Account
|
||||
{
|
||||
public class RegisterModel
|
||||
{
|
||||
|
||||
[StringLength(Constants.MaxUserNameLength)]
|
||||
[RegularExpression(Constants.UserNameRegExp)]
|
||||
[DataType(DataType.Text)]
|
||||
[Display(Name = "UserName", Description = "User name")]
|
||||
public string UserName { get; set; }
|
||||
|
||||
[Required()]
|
||||
[StringLength( maximumLength:102, MinimumLength = 5)]
|
||||
// [EmailAddress]
|
||||
[Display(Name = "Email", Description = "E-Mail")]
|
||||
public string Email { get; set; }
|
||||
|
||||
[StringLength(maximumLength:100, MinimumLength = 6,
|
||||
ErrorMessage = "Le mot de passe doit contenir au moins 8 caratères")]
|
||||
[DataType(DataType.Password)]
|
||||
[Display(Name = "Password")]
|
||||
public string Password { get; set; }
|
||||
|
||||
[DataType(DataType.Password)]
|
||||
[Compare("Password")]
|
||||
[Display(Name = "ConfirmPassword", Description ="Password Confirmation")]
|
||||
public string ConfirmPassword { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.Models.Auth {
|
||||
public class Scope {
|
||||
|
||||
|
||||
[Key][Required]
|
||||
|
||||
public string Id { get; set; }
|
||||
|
||||
[MaxLength(1024)][Required]
|
||||
|
||||
public string Description { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
namespace Yavsc.Models.Billing
|
||||
{
|
||||
public static class BillingCodes
|
||||
{
|
||||
public const string Rdv = "Rdv";
|
||||
public const string MBrush = "MBrush";
|
||||
|
||||
public const string Brush = "Brush";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
namespace Yavsc
|
||||
{
|
||||
public interface IAccountBalance
|
||||
{
|
||||
long ContactCredits { get; set; }
|
||||
decimal Credits { get; set; }
|
||||
string UserId { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
namespace Yavsc.Billing
|
||||
{
|
||||
public interface IBillItem {
|
||||
|
||||
string Name { get; set; }
|
||||
string Description { get; set; }
|
||||
int Count { get; set; }
|
||||
decimal UnitaryCost { get; set; }
|
||||
string Currency { get; set; }
|
||||
|
||||
string Reference { get; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Yavsc.Services;
|
||||
|
||||
namespace Yavsc.Billing
|
||||
{
|
||||
public interface IBillable {
|
||||
string Description { get; }
|
||||
List<IBillItem> GetBillItems();
|
||||
long Id { get; set; }
|
||||
|
||||
string ActivityCode { get; set; }
|
||||
|
||||
string PerformerId { get; set; }
|
||||
string ClientId { get; set; }
|
||||
/// <summary>
|
||||
/// Date de validation de la demande par le client
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
|
||||
DateTime? ValidationDate { get; }
|
||||
|
||||
bool GetIsAcquitted ();
|
||||
|
||||
string GetFileBaseName (IBillingService service);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
|
||||
namespace Yavsc.Billing
|
||||
{
|
||||
public interface IBillingImpacter {
|
||||
decimal Impact(decimal orgValue);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
|
||||
namespace Yavsc.Billing
|
||||
{
|
||||
|
||||
public interface ICommandLine : IBillItem
|
||||
{
|
||||
// FIXME too hard: no such generic name in any interface
|
||||
long Id { get; set; }
|
||||
|
||||
// FIXME too far: perhaps no existing estimate
|
||||
long EstimateId { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
namespace Yavsc
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
|
||||
public interface IEstimate
|
||||
{
|
||||
List<string> AttachedFiles { get; set; }
|
||||
List<string> AttachedGraphics { get; }
|
||||
string ClientId { get; set; }
|
||||
long? CommandId { get; set; }
|
||||
string CommandType { get; set; }
|
||||
string Description { get; set; }
|
||||
long Id { get; set; }
|
||||
string OwnerId { get; set; }
|
||||
string Title { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
|
||||
|
||||
|
||||
using Yavsc.Abstract.Identity;
|
||||
|
||||
namespace Yavsc
|
||||
{
|
||||
public interface IBlogPostPayLoad
|
||||
{
|
||||
string? Content { get; set; }
|
||||
string? Photo { get; set; }
|
||||
|
||||
}
|
||||
public interface IBlogPost : IBlogPostPayLoad, ITrackedEntity, IIdentified<long>, ITitle
|
||||
{
|
||||
string AuthorId { get; set; }
|
||||
IApplicationUser Author { get; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
namespace Yavsc.Abstract.Chat
|
||||
{
|
||||
public static class ChatHubConstants
|
||||
{
|
||||
public const string HubGroupAuthenticated = "authenticated";
|
||||
public const string HubGroupAnonymous = "anonymous";
|
||||
public const string HubGroupCops= "cops";
|
||||
public const string HubGroupRomsPrefix = "room_";
|
||||
public const int MaxChanelName = 255;
|
||||
|
||||
public const string HubGroupFollowingPrefix = "fol ";
|
||||
public const string AnonymousUserNamePrefix = "?";
|
||||
public const string KeyParamChatUserName = "username";
|
||||
|
||||
public const string JustCreatedBy = "just created by ";
|
||||
public const string LabYouNotOp = "you're no op.";
|
||||
public const string LabNoSuchUser = "No such user";
|
||||
public const string LabNoSuchChan = "No such chan";
|
||||
public const string HopWontKickOp = "Half operator cannot kick any operator";
|
||||
public const string LabAuthChatUser = "Authenticated chat user";
|
||||
public const string NoKickOnCop = "No, you won´t, you´ĺl never do kick a cop, it is the bad.";
|
||||
public const string LabnoJoinNoSend = "LabnoJoinNoSend";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
namespace Yavsc.Abstract.Chat
|
||||
{
|
||||
public enum ChatRoomAccessLevel: int {
|
||||
None=0,
|
||||
Voice,
|
||||
Op,
|
||||
HalfOp
|
||||
}
|
||||
}
|
||||
|
|
@ -1,90 +0,0 @@
|
|||
//
|
||||
// ChatHub.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paul@pschneider.fr>
|
||||
//
|
||||
// Copyright (c) 2016-2019 GNU GPL
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Yavsc;
|
||||
|
||||
namespace Yavsc
|
||||
{
|
||||
public class HubInputValidator {
|
||||
|
||||
public Action<string,string,string> NotifyUser {get;set;}
|
||||
public bool ValidateRoomName (string roomName)
|
||||
{
|
||||
bool valid = ValidateStringLength(roomName,1,25);
|
||||
if (valid) valid = IsLetterOrDigit(roomName);
|
||||
if (!valid) NotifyUser(NotificationTypes.Error, "roomName", ChatHubLabels.InvalidRoomName);
|
||||
return valid;
|
||||
}
|
||||
public bool ValidateUserName (string userName)
|
||||
{
|
||||
bool valid = true;
|
||||
|
||||
if (userName.Length<1 || userName[0] == '?' && userName.Length<2) valid = false;
|
||||
if (valid) {
|
||||
string suname = (userName[0] == '?') ? userName.Substring(1) : userName;
|
||||
if (valid) valid = ValidateStringLength(suname, 1,12);
|
||||
if (valid) valid = IsLetterOrDigit(userName);
|
||||
}
|
||||
if (!valid) NotifyUser(NotificationTypes.Error, "userName" , ChatHubLabels.InvalidUserName);
|
||||
return valid;
|
||||
}
|
||||
public bool ValidateMessage (string message)
|
||||
{
|
||||
if (!ValidateStringLength(message, 1, 10240))
|
||||
{
|
||||
NotifyUser(NotificationTypes.Error, "message", ChatHubLabels.InvalidMessage);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public bool ValidateReason (string reason)
|
||||
{
|
||||
if (!ValidateStringLength(reason, 1,240))
|
||||
{
|
||||
NotifyUser(NotificationTypes.Error, "reason", ChatHubLabels.InvalidReason);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
static bool ValidateStringLength(string str, int minLen, int maxLen)
|
||||
{
|
||||
if (string.IsNullOrEmpty(str))
|
||||
{
|
||||
if (minLen<=0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (str.Length>maxLen||str.Length<minLen) return false;
|
||||
return true;
|
||||
}
|
||||
static bool IsLetterOrDigit(string s)
|
||||
{
|
||||
foreach (var c in s)
|
||||
if (!char.IsLetterOrDigit(c))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.Abstract.Chat
|
||||
{
|
||||
public interface IChatRoom<TMod> where TMod : IChatRoomAccess
|
||||
{
|
||||
[RegularExpression(@"^#?[a-zA-Z0-9'-']{3,10}$", ErrorMessage = "chan name cannot be validated.")]
|
||||
string Name { get; }
|
||||
|
||||
[RegularExpression(@"^#?[a-zA-Z0-9'-']{3,255}$", ErrorMessage = "topic cannot be validated.")]
|
||||
string Topic { get ; set; }
|
||||
|
||||
string OwnerId { get ; }
|
||||
|
||||
List<TMod> Moderation { get; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
namespace Yavsc.Abstract.Chat
|
||||
{
|
||||
|
||||
public interface IChatRoomAccess
|
||||
{
|
||||
long Id { get; }
|
||||
|
||||
ChatRoomAccessLevel Level { get; set; }
|
||||
|
||||
string UserId { get; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
namespace Yavsc.Abstract.Chat
|
||||
{
|
||||
|
||||
public interface IChatUserInfo
|
||||
{
|
||||
string UserId { get; set; }
|
||||
|
||||
string UserName { get; set; }
|
||||
|
||||
string Avatar { get; set; }
|
||||
|
||||
string[] Roles { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
namespace Yavsc.Abstract.Chat
|
||||
{
|
||||
public interface IConnection
|
||||
{
|
||||
string ConnectionId { get; set; }
|
||||
string UserAgent { get; set; }
|
||||
bool Connected { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
using Yavsc.Models.Auth;
|
||||
|
||||
namespace Yavsc
|
||||
{
|
||||
|
||||
public static class Constants
|
||||
{
|
||||
public static readonly Scope[] SiteScopes = {
|
||||
new Scope { Id = "profile", Description = "Your profile informations" },
|
||||
new Scope { Id = "book" , Description ="Your booking interface"},
|
||||
new Scope { Id = "blog" , Description ="Your blogging interface"},
|
||||
new Scope { Id = "estimate" , Description ="Your estimation interface"},
|
||||
new Scope { Id = "contract" , Description ="Your contract signature access"},
|
||||
new Scope { Id = "admin" , Description ="Your administration rights on this site"},
|
||||
new Scope { Id = "moderation" , Description ="Your moderator interface"},
|
||||
new Scope { Id = "frontoffice" , Description ="Your front office interface" }
|
||||
};
|
||||
|
||||
public const string CompanyClaimType = "https://schemas.pschneider.fr/identity/claims/Company";
|
||||
public const string UserNameRegExp = @"^[a-zA-Z][a-zA-Z0-9._-]*$";
|
||||
public const string UserFileNamePatternRegExp = @"^([a-zA-Z0-9._-]*/)*[a-zA-Z0-9._-]+$";
|
||||
|
||||
public const string LoginPath = "/signin";
|
||||
public const string LogoutPath = "/signout";
|
||||
|
||||
public const string UserFilesPath = "/files";
|
||||
public const string AvatarsPath = "/avatars";
|
||||
public const string GitPath = "/sources";
|
||||
public const string DefaultFactor = "Default";
|
||||
public const string MobileAppFactor = "Mobile Application";
|
||||
public const string SMSFactor = "SMS";
|
||||
public const string AdminGroupName = "Administrator";
|
||||
public const string PerformerGroupName = "Performer";
|
||||
public const string StarGroupName = "Star";
|
||||
public const string StarHunterGroupName = "StarHunter";
|
||||
public const string BlogModeratorGroupName = "Moderator";
|
||||
public const string FrontOfficeGroupName = "FrontOffice";
|
||||
public const string DefaultAvatar = "/images/Users/icon_user.png";
|
||||
public const string AnonAvatar = "/images/Users/icon_anon_user.png";
|
||||
public const string YavscConnectionStringEnvName = "YAVSC_CONNECTION_STRING";
|
||||
|
||||
// at the end, let 4*4 bytes in peace
|
||||
public const int WebSocketsMaxBufLen = 4096;
|
||||
|
||||
public static readonly long DefaultFSQ = 1024 * 1024 * 500;
|
||||
|
||||
|
||||
public const string SshHeaderKey = "SSH";
|
||||
|
||||
public static readonly string NoneCode = "none";
|
||||
|
||||
public const int MaxUserNameLength = 26;
|
||||
|
||||
public const string LivePath = "/live/cast";
|
||||
|
||||
public const string StreamingPath = "/api/stream/put";
|
||||
|
||||
public static string RoleClaimType = "http://schemas.microsoft.com/ws/2008/06/identity/claims/role";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Yavsc.ViewModels.UserFiles;
|
||||
|
||||
namespace Yavsc.Server.Helpers
|
||||
{
|
||||
public static class AbstractFileSystemHelpers
|
||||
{
|
||||
public static string UserBillsDirName { set; get; }
|
||||
public static string UserFilesDirName { set; get; }
|
||||
|
||||
/// <summary>
|
||||
/// Is Valid this Path?
|
||||
/// Return true when given value is a valid user file sub-path,
|
||||
/// regarding chars used to specify it.
|
||||
/// </summary>
|
||||
/// <param name="path">Path to validate</param>
|
||||
/// <returns></returns>
|
||||
public static bool IsValidYavscPath(this string path)
|
||||
{
|
||||
if (string.IsNullOrEmpty(path)) return true;
|
||||
// disallow full path specification
|
||||
if (path[0]==Path.DirectorySeparatorChar) return false;
|
||||
foreach (var name in path.Split(Path.DirectorySeparatorChar))
|
||||
{
|
||||
if (!IsValidDirectoryName(name) || name.Equals("..") || name.Equals("."))
|
||||
return false;
|
||||
}
|
||||
// disallow trailling slash
|
||||
if (path[path.Length-1]==RemoteDirectorySeparator) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool IsValidDirectoryName(this string name)
|
||||
{
|
||||
return !name.Any(c => !ValidFileNameChars.Contains(c));
|
||||
}
|
||||
|
||||
public static bool IsValidShortFileName(this string name)
|
||||
{
|
||||
if (name.Any(c => !ValidFileNameChars.Contains(c)))
|
||||
return false;
|
||||
|
||||
if (!name.Any(c => !AlfaNum.Contains(c)))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Ensure this path is canonical,
|
||||
// No "dirto/./this", neither "dirt/to/that/"
|
||||
// no .. and each char must be listed as valid in constants
|
||||
public static string FilterFileName(string fileName)
|
||||
{
|
||||
if (fileName==null) return null;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
foreach (var c in fileName)
|
||||
{
|
||||
if (ValidFileNameChars.Contains(c))
|
||||
sb.Append(c);
|
||||
else sb.Append("#" + ((int)c).ToString("D3"));
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public static UserDirectoryInfo GetUserFiles(string userId, string subdir)
|
||||
{
|
||||
UserDirectoryInfo di = new UserDirectoryInfo(UserFilesDirName, userId, subdir);
|
||||
return di;
|
||||
}
|
||||
public static bool IsRegularFile(string userName, string subdir)
|
||||
{
|
||||
FileInfo fi = new FileInfo( Path.Combine(Path.Combine(UserFilesDirName, userName), subdir));
|
||||
return fi.Exists;
|
||||
}
|
||||
|
||||
|
||||
// Server side only supports POSIX file systems
|
||||
public const char RemoteDirectorySeparator = '/';
|
||||
|
||||
public static char[] AlfaNum = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".ToCharArray();
|
||||
// Only accept descent remote file names
|
||||
public static char[] ValidFileNameChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-=_~. %#@".ToCharArray();
|
||||
|
||||
// Estimate signature file name format
|
||||
public static Func<string, string, long, string>
|
||||
SignFileNameFormat = new Func<string, string, long, string>((signType, billingCode, estimateId) => $"sign-{billingCode}-{signType}-{estimateId}.png");
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
using Yavsc.Abstract.FileSystem;
|
||||
|
||||
namespace Yavsc.ViewModels.UserFiles
|
||||
{
|
||||
public class DirectoryShortInfo: IDirectoryShortInfo {
|
||||
public string Name { get; set; }
|
||||
public bool IsEmpty { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
namespace Yavsc.Abstract.Helpers
|
||||
{
|
||||
public enum ErrorCode {
|
||||
NotFound,
|
||||
InternalError,
|
||||
DestExists,
|
||||
InvalidRequest
|
||||
}
|
||||
|
||||
public class FsOperationInfo {
|
||||
|
||||
public bool Done { get; set; } = false;
|
||||
|
||||
public ErrorCode ErrorCode { get; set; }
|
||||
public string? ErrorMessage { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
namespace Yavsc.Abstract.FileSystem {
|
||||
|
||||
public interface IDirectoryShortInfo
|
||||
{
|
||||
string Name { get; set; }
|
||||
bool IsEmpty { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
namespace Yavsc.Abstract.FileSystem
|
||||
{
|
||||
public interface IFileReceivedInfo
|
||||
{
|
||||
|
||||
string DestDir { get; set; }
|
||||
|
||||
string FileName { get; set; }
|
||||
|
||||
bool Overridden { get; set; }
|
||||
|
||||
bool QuotaOffense { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using Yavsc.Attributes.Validation;
|
||||
namespace Yavsc.Models.FileSystem
|
||||
{
|
||||
|
||||
public class MoveFileQuery
|
||||
{
|
||||
[ValidRemoteUserFilePath]
|
||||
[StringLength(512)]
|
||||
public required string Id { get; set; }
|
||||
|
||||
[StringLength(512)]
|
||||
[ValidRemoteUserFilePath]
|
||||
public required string To { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
using System;
|
||||
|
||||
namespace Yavsc.ViewModels
|
||||
{
|
||||
public class RemoteFileInfo
|
||||
{
|
||||
public string Name { get; set; }
|
||||
|
||||
public long Size { get; set; }
|
||||
|
||||
public DateTime CreationTime { get; set; }
|
||||
|
||||
public DateTime LastModified { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Yavsc.Abstract.FileSystem;
|
||||
using Yavsc.Server.Helpers;
|
||||
|
||||
namespace Yavsc.ViewModels.UserFiles
|
||||
{
|
||||
public class UserDirectoryInfo
|
||||
{
|
||||
public string UserName { get; set; }
|
||||
public string SubPath { get; set; }
|
||||
public RemoteFileInfo [] Files {
|
||||
get; set;
|
||||
}
|
||||
public DirectoryShortInfo [] SubDirectories {
|
||||
get; set;
|
||||
}
|
||||
private readonly DirectoryInfo dInfo;
|
||||
|
||||
// for deserialization
|
||||
public UserDirectoryInfo()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public UserDirectoryInfo(string userReposPath, string userId, string path)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(userId))
|
||||
throw new NotSupportedException("No user name, no user dir.");
|
||||
UserName = userId;
|
||||
var finalPath = path == null ? userId : Path.Combine(userId, path);
|
||||
if (!finalPath.IsValidYavscPath())
|
||||
throw new InvalidOperationException(
|
||||
$"File name contains invalid chars ({finalPath})");
|
||||
|
||||
dInfo = new DirectoryInfo(
|
||||
userReposPath+Path.DirectorySeparatorChar+finalPath);
|
||||
if (dInfo.Exists) {
|
||||
|
||||
Files = dInfo.GetFiles().Select
|
||||
( entry => new RemoteFileInfo { Name = entry.Name, Size = entry.Length,
|
||||
CreationTime = entry.CreationTime, LastModified = entry.LastWriteTime }).ToArray();
|
||||
SubDirectories = dInfo.GetDirectories().Select
|
||||
( d=> new DirectoryShortInfo { Name= d.Name, IsEmpty=false } ).ToArray();
|
||||
}
|
||||
else {
|
||||
// don't return null, but empty arrays
|
||||
Files = new RemoteFileInfo[0];
|
||||
SubDirectories = new DirectoryShortInfo[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
//
|
||||
// CalendarEventList.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paulschneider@free.fr>
|
||||
//
|
||||
// Copyright (c) 2015 Paul Schneider
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
using System;
|
||||
|
||||
namespace Yavsc.Models.Google
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Calendar event list.
|
||||
/// </summary>
|
||||
[Obsolete("use GoogleUse.Apis")]
|
||||
public class CalendarEventList
|
||||
{
|
||||
/// <summary>
|
||||
/// The next page token.
|
||||
/// </summary>
|
||||
public string nextPageToken;
|
||||
/// <summary>
|
||||
/// The next sync token.
|
||||
/// </summary>
|
||||
public string nextSyncToken;
|
||||
/// <summary>
|
||||
/// The items.
|
||||
/// </summary>
|
||||
public Resource [] items ;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
//
|
||||
// CalendarList.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paulschneider@free.fr>
|
||||
//
|
||||
// Copyright (c) 2014 Paul Schneider
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Yavsc.Models.Google.Calendar
|
||||
{
|
||||
/// <summary>
|
||||
/// Calendar list.
|
||||
/// </summary>
|
||||
[Obsolete("use Google.Apis")]
|
||||
public class CalendarList {
|
||||
/// <summary>
|
||||
/// Gets or sets the kind.
|
||||
/// </summary>
|
||||
/// <value>The kind.</value>
|
||||
public string kind { get; set;}
|
||||
/// <summary>
|
||||
/// Gets or sets the etag.
|
||||
/// </summary>
|
||||
/// <value>The etag.</value>
|
||||
public string etag { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the next sync token.
|
||||
/// </summary>
|
||||
/// <value>The next sync token.</value>
|
||||
public string description { get; set; }
|
||||
public string summpary { get; set; }
|
||||
public string nextSyncToken { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the items.
|
||||
/// </summary>
|
||||
/// <value>The items.</value>
|
||||
public CalendarListEntry[] items { get; set; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,114 +0,0 @@
|
|||
//
|
||||
// CalendarListEntry.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paulschneider@free.fr>
|
||||
//
|
||||
// Copyright (c) 2014 Paul Schneider
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Yavsc.Models.Google.Calendar
|
||||
{
|
||||
/// <summary>
|
||||
/// Calendar list entry.
|
||||
/// </summary>
|
||||
///
|
||||
[Obsolete("use GoogleUse.Apis")]
|
||||
public class CalendarListEntry {
|
||||
/// <summary>
|
||||
/// Gets or sets the kind.
|
||||
/// </summary>
|
||||
/// <value>The kind.</value>
|
||||
public string kind { get; set;}
|
||||
/// <summary>
|
||||
/// Gets or sets the etag.
|
||||
/// </summary>
|
||||
/// <value>The etag.</value>
|
||||
public string etag { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the identifier.
|
||||
/// </summary>
|
||||
/// <value>The identifier.</value>
|
||||
public string id { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the summary.
|
||||
/// </summary>
|
||||
/// <value>The summary.</value>
|
||||
public string summary { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the description.
|
||||
/// </summary>
|
||||
/// <value>The description.</value>
|
||||
public string description { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the time zone.
|
||||
/// </summary>
|
||||
/// <value>The time zone.</value>
|
||||
public string timeZone { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the color identifier.
|
||||
/// </summary>
|
||||
/// <value>The color identifier.</value>
|
||||
public string colorId { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the color of the background.
|
||||
/// </summary>
|
||||
/// <value>The color of the background.</value>
|
||||
public string backgroundColor { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the color of the foreground.
|
||||
/// </summary>
|
||||
/// <value>The color of the foreground.</value>
|
||||
public string foregroundColor { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this <see cref="Yavsc.Model.Google.CalendarListEntry"/> is selected.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if selected; otherwise, <c>false</c>.</value>
|
||||
public bool selected { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this <see cref="Yavsc.Model.Google.CalendarListEntry"/> is primary.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if primary; otherwise, <c>false</c>.</value>
|
||||
public bool primary { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the access role.
|
||||
/// </summary>
|
||||
/// <value>The access role.</value>
|
||||
public string accessRole { get; set; }
|
||||
/// <summary>
|
||||
/// Reminder.
|
||||
/// </summary>
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the default reminders.
|
||||
/// </summary>
|
||||
/// <value>The default reminders.</value>
|
||||
public Reminder[] defaultReminders { get; set; }
|
||||
/* "notificationSettings": { "notifications":
|
||||
[ { "type": "eventCreation", "method": "email" },
|
||||
{ "type": "eventChange", "method": "email" },
|
||||
{ "type": "eventCancellation", "method": "email" },
|
||||
{ "type": "eventResponse", "method": "email" } ] }, "primary": true },
|
||||
|
||||
*/
|
||||
}
|
||||
/// <summary>
|
||||
/// Reminder.
|
||||
/// </summary>
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
using System;
|
||||
|
||||
namespace Yavsc.Models.Google.Calendar
|
||||
{
|
||||
[Obsolete("use GoogleUse.Apis")]
|
||||
public class Reminder {
|
||||
/// <summary>
|
||||
/// Gets or sets the method.
|
||||
/// </summary>
|
||||
/// <value>The method.</value>
|
||||
public string method { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the minutes.
|
||||
/// </summary>
|
||||
/// <value>The minutes.</value>
|
||||
public int minutes { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
//
|
||||
// GDate.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paulschneider@free.fr>
|
||||
//
|
||||
// Copyright (c) 2015 Paul Schneider
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
using System;
|
||||
|
||||
namespace Yavsc.Models.Google
|
||||
{
|
||||
/// <summary>
|
||||
/// G date.
|
||||
/// </summary>
|
||||
public class GDate {
|
||||
/// <summary>
|
||||
/// The date.
|
||||
/// </summary>
|
||||
public DateTime? date;
|
||||
/// <summary>
|
||||
/// The datetime.
|
||||
/// </summary>
|
||||
public DateTime? datetime;
|
||||
/// <summary>
|
||||
/// The time zone.
|
||||
/// </summary>
|
||||
public string timeZone;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
//
|
||||
// MessageWithPayLoad.cs
|
||||
//
|
||||
// Author:
|
||||
// paul <>
|
||||
//
|
||||
// Copyright (c) 2015 paul
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using Yavsc.Abstract.Models.Messaging;
|
||||
using Yavsc.Models.Messaging;
|
||||
|
||||
namespace Yavsc.Models.Google.Messaging
|
||||
{
|
||||
// https://gcm-http.googleapis.com/gcm/send
|
||||
/// <summary>
|
||||
/// Message with payload.
|
||||
/// </summary>
|
||||
public class MessageWithPayload<T> {
|
||||
/// <summary>
|
||||
/// To.
|
||||
/// </summary>
|
||||
public string to;
|
||||
/// <summary>
|
||||
/// The registration identifiers.
|
||||
/// </summary>
|
||||
public string [] registration_ids;
|
||||
/// <summary>
|
||||
/// The data.
|
||||
/// </summary>
|
||||
public T data ;
|
||||
/// <summary>
|
||||
/// The notification.
|
||||
/// </summary>
|
||||
public Notification notification;
|
||||
/// <summary>
|
||||
/// The collapse key.
|
||||
/// </summary>
|
||||
public string collapse_key; // in order to collapse ...
|
||||
/// <summary>
|
||||
/// The priority.
|
||||
/// </summary>
|
||||
public int priority; // between 0 and 10, 10 is the lowest!
|
||||
/// <summary>
|
||||
/// The content available.
|
||||
/// </summary>
|
||||
public bool content_available;
|
||||
/// <summary>
|
||||
/// The delay while idle.
|
||||
/// </summary>
|
||||
public bool delay_while_idle;
|
||||
/// <summary>
|
||||
/// The time to live.
|
||||
/// </summary>
|
||||
public int time_to_live; // seconds
|
||||
/// <summary>
|
||||
/// The name of the restricted package.
|
||||
/// </summary>
|
||||
public string restricted_package_name;
|
||||
/// <summary>
|
||||
/// The dry run.
|
||||
/// </summary>
|
||||
public bool dry_run;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
//
|
||||
// MessageWithPayloadResponse.cs
|
||||
//
|
||||
// Author:
|
||||
// paul <paul@pschneider.fr>
|
||||
//
|
||||
// Copyright (c) 2015 paul
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
namespace Yavsc.Models.Google.Messaging
|
||||
{
|
||||
// https://gcm-http.googleapis.com/gcm/send
|
||||
|
||||
/// <summary>
|
||||
/// Message with payload response.
|
||||
/// </summary>
|
||||
public class MessageWithPayloadResponse {
|
||||
/// <summary>
|
||||
/// The success count.
|
||||
/// </summary>
|
||||
public int success;
|
||||
/// <summary>
|
||||
/// The failure count.
|
||||
/// </summary>
|
||||
public int failure;
|
||||
/// <summary>
|
||||
/// The canonical identifiers... ?!?
|
||||
/// </summary>
|
||||
public string canonical_ids;
|
||||
/// <summary>
|
||||
/// Detailled result.
|
||||
/// </summary>
|
||||
public class Result {
|
||||
/// <summary>
|
||||
/// The message identifier.
|
||||
/// </summary>
|
||||
public string message_id;
|
||||
/// <summary>
|
||||
/// The registration identifier.
|
||||
/// </summary>
|
||||
public string registration_id;
|
||||
/// <summary>
|
||||
/// The error.
|
||||
/// </summary>
|
||||
public string? error;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The results.
|
||||
/// </summary>
|
||||
public Result [] results;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,165 +0,0 @@
|
|||
//
|
||||
// People.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paulschneider@free.fr>
|
||||
//
|
||||
// Copyright (c) 2014 Paul Schneider
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
namespace Yavsc.Models.Google
|
||||
{
|
||||
/// <summary>
|
||||
/// People.
|
||||
/// </summary>
|
||||
public class People {
|
||||
/// <summary>
|
||||
/// Gets or sets the kind.
|
||||
/// </summary>
|
||||
/// <value>The kind.</value>
|
||||
public string kind { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the etag.
|
||||
/// </summary>
|
||||
/// <value>The etag.</value>
|
||||
public string etag { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the gender.
|
||||
/// </summary>
|
||||
/// <value>The gender.</value>
|
||||
public string gender { get; set; }
|
||||
/// <summary>
|
||||
/// E mail.
|
||||
/// </summary>
|
||||
public class EMail{
|
||||
/// <summary>
|
||||
/// Gets or sets the value.
|
||||
/// </summary>
|
||||
/// <value>The value.</value>
|
||||
public string value { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the type.
|
||||
/// </summary>
|
||||
/// <value>The type.</value>
|
||||
public string type { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets or sets the emails.
|
||||
/// </summary>
|
||||
/// <value>The emails.</value>
|
||||
public EMail[] emails { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the type of the object.
|
||||
/// </summary>
|
||||
/// <value>The type of the object.</value>
|
||||
public string objectType { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the identifier.
|
||||
/// </summary>
|
||||
/// <value>The identifier.</value>
|
||||
public string id { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the display name.
|
||||
/// </summary>
|
||||
/// <value>The display name.</value>
|
||||
public string displayName { get; set; }
|
||||
/// <summary>
|
||||
/// Name.
|
||||
/// </summary>
|
||||
public class Name {
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the family.
|
||||
/// </summary>
|
||||
/// <value>The name of the family.</value>
|
||||
public string familyName { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the given.
|
||||
/// </summary>
|
||||
/// <value>The name of the given.</value>
|
||||
public string givenName { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets or sets the name.
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
public Name name { get; set;}
|
||||
/// <summary>
|
||||
/// Gets or sets the URL.
|
||||
/// </summary>
|
||||
/// <value>The URL.</value>
|
||||
public string url { get; set; }
|
||||
/// <summary>
|
||||
/// Image.
|
||||
/// </summary>
|
||||
public class Image {
|
||||
/// <summary>
|
||||
/// Gets or sets the URL.
|
||||
/// </summary>
|
||||
/// <value>The URL.</value>
|
||||
public string url { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this <see cref="Yavsc.Model.Google.People.Image"/> is default.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if is default; otherwise, <c>false</c>.</value>
|
||||
public bool isDefault { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets or sets the image.
|
||||
/// </summary>
|
||||
/// <value>The image.</value>
|
||||
public Image image { get; set; }
|
||||
/// <summary>
|
||||
/// Place.
|
||||
/// </summary>
|
||||
public class Place {
|
||||
/// <summary>
|
||||
/// Gets or sets the value.
|
||||
/// </summary>
|
||||
/// <value>The value.</value>
|
||||
public string value { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this <see cref="Yavsc.Model.Google.People.Place"/> is primary.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if primary; otherwise, <c>false</c>.</value>
|
||||
public bool primary { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets or sets the places lived.
|
||||
/// </summary>
|
||||
/// <value>The places lived.</value>
|
||||
public Place[] placesLived { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this <see cref="Yavsc.Model.Google.People"/> is plus user.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if is plus user; otherwise, <c>false</c>.</value>
|
||||
public bool isPlusUser { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the language.
|
||||
/// </summary>
|
||||
/// <value>The language.</value>
|
||||
public string language { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the circled by count.
|
||||
/// </summary>
|
||||
/// <value>The circled by count.</value>
|
||||
public int circledByCount { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this <see cref="Yavsc.Model.Google.People"/> is verified.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if verified; otherwise, <c>false</c>.</value>
|
||||
public bool verified { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
//
|
||||
// Resource.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paulschneider@free.fr>
|
||||
//
|
||||
// Copyright (c) 2015 Paul Schneider
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
namespace Yavsc.Models.Google
|
||||
{
|
||||
/// <summary>
|
||||
/// Resource.
|
||||
/// </summary>
|
||||
public class Resource {
|
||||
public string id;
|
||||
public string location;
|
||||
public string status;
|
||||
public GDate start;
|
||||
public GDate end;
|
||||
public string recurence;
|
||||
|
||||
public string description;
|
||||
|
||||
public string summary;
|
||||
|
||||
/// <summary>
|
||||
/// Available <=> transparency == "transparent"
|
||||
/// </summary>
|
||||
public string transparency;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
//
|
||||
// Entity.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paulschneider@free.fr>
|
||||
//
|
||||
// Copyright (c) 2015 Paul Schneider
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
namespace Yavsc.Models.Google
|
||||
{
|
||||
/// <summary>
|
||||
/// Entity.
|
||||
/// </summary>
|
||||
public class Entity
|
||||
{
|
||||
/// <summary>
|
||||
/// The I.
|
||||
/// </summary>
|
||||
public string ID;
|
||||
/// <summary>
|
||||
/// The name.
|
||||
/// </summary>
|
||||
public string Name;
|
||||
|
||||
/// <summary>
|
||||
/// The type: AUTOMOBILE: A car or passenger vehicle.
|
||||
/// * TRUCK: A truck or cargo vehicle.
|
||||
/// * WATERCRAFT: A boat or other waterborne vehicle.
|
||||
/// * PERSON: A person.
|
||||
/// </summary>
|
||||
public string Type;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
//
|
||||
// EntityQuery.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paulschneider@free.fr>
|
||||
//
|
||||
// Copyright (c) 2015 Paul Schneider
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
namespace Yavsc.Models.Google
|
||||
{
|
||||
/// <summary>
|
||||
/// Entity query.
|
||||
/// </summary>
|
||||
public class EntityQuery {
|
||||
/// <summary>
|
||||
/// The entity identifiers.
|
||||
/// </summary>
|
||||
public string [] EntityIds;
|
||||
/// <summary>
|
||||
/// The minimum identifier.
|
||||
/// </summary>
|
||||
public string MinId;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using Yavsc.Attributes.Validation;
|
||||
|
||||
namespace Yavsc.ApiControllers
|
||||
{
|
||||
public class BugReport {
|
||||
[Required,YaStringLength(1024)]
|
||||
public string ApiKey { get ; set; }
|
||||
[Required,YaStringLength(512)]
|
||||
public string Component { get ; set; }
|
||||
[Required][YaStringLength(10240)]
|
||||
public string ExceptionObjectJson { get ; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Yavsc.Abstract.IT {
|
||||
|
||||
public class CiBuildSettings
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// The global process environment variables
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
[JsonProperty("env")]
|
||||
public string[] Environment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The required building command.
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
[Required]
|
||||
[JsonPropertyAttribute("build")]
|
||||
public CommandPipe Build { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A preparing command.
|
||||
/// It is optional, but when specified,
|
||||
/// must end ok in order to launch the build.
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
[JsonPropertyAttribute("prepare")]
|
||||
public CommandPipe Prepare { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A post-production command,
|
||||
/// for an example, some publishing,
|
||||
/// push in prod env ...
|
||||
/// only fired on successful build.
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
[JsonPropertyAttribute("post_build")]
|
||||
public CommandPipe PostBuild { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Additional emails, as dest of notifications
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
[JsonPropertyAttribute("emails")]
|
||||
public string[] Emails { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,98 +0,0 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Yavsc.Abstract.IT
|
||||
{
|
||||
|
||||
public class CharArray : List<char>, IEnumerable<char>, IList<char>
|
||||
{
|
||||
|
||||
public CharArray (char [] charArray) : base (charArray)
|
||||
{
|
||||
|
||||
}
|
||||
public CharArray (IList<char> word): base(word) {
|
||||
|
||||
}
|
||||
public CharArray (IEnumerable<char> word): base(word) {
|
||||
|
||||
}
|
||||
|
||||
public IList<char> Aggregate(char other)
|
||||
{
|
||||
this.Add(other);
|
||||
return this;
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
}
|
||||
}
|
||||
|
||||
public class CodeFromChars : List<CharArray>, ICode<char>
|
||||
{
|
||||
public void AddLetter(IEnumerable<char> letter)
|
||||
{
|
||||
var candide = new CharArray(letter);
|
||||
|
||||
// TODO build new denied letters: compute the automate
|
||||
// and check it is determinised
|
||||
// Automate a = new Automate();
|
||||
Add(candide);
|
||||
}
|
||||
|
||||
public bool Validate()
|
||||
{
|
||||
// this is a n*n task
|
||||
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
IEnumerator<IEnumerable<char>> IEnumerable<IEnumerable<char>>.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
}
|
||||
|
||||
private class Automate
|
||||
{
|
||||
int State { get; set; }
|
||||
|
||||
Dictionary<int, Dictionary<int,int>> Transitions { get; set; }
|
||||
|
||||
CodeFromChars Code { get; set; }
|
||||
|
||||
void Compute(CharArray chars)
|
||||
{
|
||||
if (!Code.Contains(chars)) {
|
||||
State = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Transitions.ContainsKey(State)) {
|
||||
State = -2;
|
||||
return;
|
||||
}
|
||||
|
||||
var states = Transitions[State];
|
||||
|
||||
int letter = Code.IndexOf(chars);
|
||||
|
||||
if (!states.ContainsKey(letter))
|
||||
{
|
||||
State = -3;
|
||||
return;
|
||||
}
|
||||
|
||||
State = states[letter];
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Diagnostics;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Yavsc.Abstract.IT
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// A command specification (a system command),
|
||||
/// in order to reference some trusted server-side process
|
||||
/// </summary>
|
||||
public class Command
|
||||
{
|
||||
[Required]
|
||||
[JsonPropertyAttribute("path")]
|
||||
public string Path { get; set; }
|
||||
|
||||
[JsonPropertyAttribute("args")]
|
||||
public string[] Args { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Specific variables for this process
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
[JsonPropertyAttribute("env")]
|
||||
public string[] Environment { get; set; }
|
||||
|
||||
public virtual Process Start(string workingDir=null, bool redirectInput=false, bool redirectOutput=false)
|
||||
{
|
||||
var procStart = new ProcessStartInfo(Path, string.Join(" ",Args));
|
||||
procStart.WorkingDirectory = workingDir;
|
||||
procStart.UseShellExecute = false;
|
||||
procStart.RedirectStandardInput = true;
|
||||
procStart.RedirectStandardOutput = true;
|
||||
procStart.RedirectStandardError = false;
|
||||
return Process.Start(procStart);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Diagnostics;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Yavsc.Abstract.IT
|
||||
{
|
||||
public class CommandPipe
|
||||
{
|
||||
|
||||
|
||||
[JsonPropertyAttribute("pipe")]
|
||||
public Command[] Pipe { get; set; }
|
||||
|
||||
|
||||
[JsonPropertyAttribute("working_dir")]
|
||||
public string WorkingDir { get; set; }
|
||||
|
||||
public virtual int Run()
|
||||
{
|
||||
Queue<Process> runQueue = new Queue<Process>();
|
||||
Queue<Task> joints = new Queue<Task>();
|
||||
if (Pipe.Length == 0) return -1;
|
||||
if (Pipe.Length == 1)
|
||||
{
|
||||
Process singlecmd = Pipe[0].Start();
|
||||
singlecmd.WaitForExit();
|
||||
return singlecmd.ExitCode;
|
||||
}
|
||||
|
||||
Command cmd = Pipe[0];
|
||||
Process newProcess = cmd.Start(WorkingDir, false, true);
|
||||
Process latest = newProcess;
|
||||
Task ending = Task.Run(() => { latest.WaitForExit(); });
|
||||
for (int i = 1; i < Pipe.Length; i++)
|
||||
{
|
||||
joints.Enqueue(ending);
|
||||
cmd = Pipe[i];
|
||||
bool isNotLast = i < Pipe.Length;
|
||||
|
||||
newProcess = cmd.Start(WorkingDir, true, isNotLast);
|
||||
var jt = Task.Run(async () =>
|
||||
{
|
||||
while (!latest.HasExited && !newProcess.HasExited)
|
||||
{
|
||||
string line = await latest.StandardOutput.ReadLineAsync();
|
||||
if (line != null)
|
||||
await newProcess.StandardInput.WriteLineAsync(line);
|
||||
}
|
||||
});
|
||||
joints.Enqueue(jt);
|
||||
|
||||
latest = newProcess;
|
||||
runQueue.Enqueue(latest);
|
||||
}
|
||||
while (runQueue.Count > 0)
|
||||
(latest = runQueue.Dequeue()).WaitForExit();
|
||||
return latest.ExitCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Attributes.Validation;
|
||||
|
||||
namespace Yavsc.Models.IT.Evolution
|
||||
{
|
||||
public class Feature
|
||||
{
|
||||
[Key,DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
|
||||
[YaStringLength(256)]
|
||||
public string ShortName { get; set; }
|
||||
|
||||
[YaStringLength(10*1024)]
|
||||
public string Description { get; set; }
|
||||
|
||||
public FeatureStatus Status { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
namespace Yavsc.Models.IT.Evolution
|
||||
{
|
||||
/// <summary>
|
||||
/// A Feature status
|
||||
/// <c>Ko</c>: A Bug has just been discovered
|
||||
/// <c>InSane</c>: This feature is not correctly integrating its ecosystem
|
||||
/// <c>Obsolete</c>: This will be replaced in a short future, or yet has been replaced
|
||||
/// with a better solution.
|
||||
/// <c>Ok</c> : nothing to say
|
||||
/// </summary>
|
||||
public enum FeatureStatus: int
|
||||
{
|
||||
Requested,
|
||||
Accepted,
|
||||
Rejected,
|
||||
Implemented
|
||||
}
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Attributes.Validation;
|
||||
using Yavsc.Models.IT.Evolution;
|
||||
|
||||
namespace Yavsc.Models.IT.Fixing
|
||||
{
|
||||
public partial class Bug
|
||||
{
|
||||
[Key,DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
|
||||
[ForeignKey("FeatureId")]
|
||||
public virtual Feature False { get; set; }
|
||||
|
||||
public long? FeatureId { get; set; }
|
||||
|
||||
[YaStringLength(240, MinimumLength=4 ,
|
||||
ErrorMessageResourceType=typeof(Yavsc.Models.IT.Fixing.Bug),
|
||||
ErrorMessageResourceName="TitleSizeError")]
|
||||
public string Title { get; set; }
|
||||
|
||||
[YaStringLength(10240,
|
||||
ErrorMessageResourceType=typeof(Yavsc.Models.IT.Fixing.Bug),
|
||||
ErrorMessageResourceName="DescSizeError")]
|
||||
public string Description { get; set; }
|
||||
|
||||
public BugStatus Status { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
namespace Yavsc.Models.IT.Fixing
|
||||
{
|
||||
/// <summary>
|
||||
/// Bug status:
|
||||
/// * Inserted -> Confirmed|FeatureRequest|Feature|Rejected
|
||||
/// * Confirmed -> Fixed
|
||||
/// * FeatureRequest -> Implemented
|
||||
/// </summary>
|
||||
public enum BugStatus : int
|
||||
{
|
||||
Inserted,
|
||||
Confirmed,
|
||||
Rejected,
|
||||
Feature,
|
||||
Fixed
|
||||
}
|
||||
}
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace Yavsc.Abstract.IT
|
||||
{
|
||||
// un code est, parmis les ensembles de suites de signes,
|
||||
// ceux qui n'ont qu'une seule suite de suites pouvant représenter toute suite de suite de signes
|
||||
|
||||
public interface ICode<TSign> : IEnumerable<IEnumerable<TSign>>
|
||||
{
|
||||
/// <summary>
|
||||
/// Checks false that a letter list combinaison correspond to another one
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
bool Validate();
|
||||
|
||||
/// <summary>
|
||||
/// Defines a new letter in this code,
|
||||
/// as an enumerable of <c>TLetter</c>
|
||||
/// </summary>
|
||||
/// <param name="letter"></param>
|
||||
/// <returns></returns>
|
||||
void AddLetter(IEnumerable<TSign> letter);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace Yavsc.Abstract.IT
|
||||
{
|
||||
public interface IProject
|
||||
{
|
||||
long Id { get; set ; }
|
||||
string OwnerId { get; set; }
|
||||
string Name { get; set; }
|
||||
string Version { get; set; }
|
||||
|
||||
IEnumerable<string> GetConfigurations();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
//
|
||||
// GoogleAuthToken.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paulschneider@free.fr>
|
||||
//
|
||||
// Copyright (c) 2014 Paul Schneider
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
namespace Yavsc.Abstract.Identity
|
||||
{
|
||||
/// <summary>
|
||||
/// Auth token, as they are received.
|
||||
/// </summary>
|
||||
public class AuthToken {
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the access token.
|
||||
/// </summary>
|
||||
/// <value>The access token.</value>
|
||||
public string access_token { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the identifier token.
|
||||
/// </summary>
|
||||
/// <value>The identifier token.</value>
|
||||
public string id_token { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the type of the token.
|
||||
/// </summary>
|
||||
/// <value>The type of the token.</value>
|
||||
public string token_type { get; set ; }
|
||||
/// <summary>
|
||||
/// Gets or sets the refresh token.
|
||||
/// </summary>
|
||||
/// <value>The refresh token.</value>
|
||||
public string refresh_token { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the expires in.
|
||||
/// </summary>
|
||||
/// <value>The expires in.</value>
|
||||
public int expires_in { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using Yavsc.Attributes.Validation;
|
||||
|
||||
namespace Yavsc.Models.Identity
|
||||
{
|
||||
public class BlackListedUserName : IWatchedUserName {
|
||||
|
||||
[Key]
|
||||
[YaStringLength(1024)]
|
||||
public string Name { get; set;}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
namespace Yavsc.Abstract.Identity
|
||||
{
|
||||
public class ClientProviderInfo
|
||||
{
|
||||
public string UserName { get; set; }
|
||||
public string Avatar { get; set; }
|
||||
|
||||
[Key]
|
||||
public string UserId { get; set; }
|
||||
public string EMail { get; set; }
|
||||
public string Phone { get; set; }
|
||||
public long BillingAddressId { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
namespace Yavsc.Abstract.Identity
|
||||
{
|
||||
public interface IApplicationUser
|
||||
{
|
||||
string Id { get; set; }
|
||||
string? UserName { get; set; }
|
||||
string? Avatar { get ; set; }
|
||||
IAccountBalance? AccountBalance { get; }
|
||||
string? DedicatedGoogleCalendar { get; }
|
||||
ILocation? PostalAddress { get; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
using Yavsc.Interfaces;
|
||||
|
||||
namespace Yavsc.Models.Identity
|
||||
{
|
||||
public interface IWatchedUserName : INamedObject {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
namespace Yavsc.Abstract.Identity {
|
||||
public class Me : UserInfo
|
||||
{
|
||||
public AuthToken Token {
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using Yavsc.Attributes.Validation;
|
||||
|
||||
namespace Yavsc.Models.Identity
|
||||
{
|
||||
public class ReservedUserName : IWatchedUserName {
|
||||
|
||||
[Key]
|
||||
[YaStringLength(1024)]
|
||||
public string Name { get; set;}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
namespace Yavsc.Abstract.Identity.Security
|
||||
{
|
||||
|
||||
public interface ICircleAuthorization
|
||||
{
|
||||
long CircleId { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
namespace Yavsc.Abstract.Identity.Security
|
||||
{
|
||||
public interface ICircleAuthorized
|
||||
{
|
||||
long Id { get; set; }
|
||||
string AuthorId { get; }
|
||||
bool AuthorizeCircle(long circleId);
|
||||
ICircleAuthorization [] GetACL();
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
using System;
|
||||
|
||||
namespace Yavsc.Abstract.Identity
|
||||
{
|
||||
public class TokenInfo
|
||||
{
|
||||
public string AccessToken { get; set; }
|
||||
public string RefreshToken { get; set; }
|
||||
public int ExpiresIn { set; get; }
|
||||
public DateTime Received { get; set; }
|
||||
public string TokenType { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
namespace Yavsc.Abstract.Identity
|
||||
{
|
||||
public class UserInfo {
|
||||
|
||||
public UserInfo()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public UserInfo(string userId, string userName, string email, string avatar)
|
||||
{
|
||||
UserId = userId;
|
||||
UserName = userName;
|
||||
Email = email;
|
||||
Avatar = avatar;
|
||||
}
|
||||
public string UserId { get; set; }
|
||||
|
||||
public string UserName { get; set; }
|
||||
public string Email { get; }
|
||||
public string Avatar { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
namespace Yavsc.Services
|
||||
{
|
||||
public interface IBankInterface
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
using System;
|
||||
|
||||
namespace Yavsc
|
||||
{
|
||||
public interface ITrackedEntity
|
||||
{
|
||||
DateTime DateCreated { get; set; }
|
||||
string? UserCreated { get; set; }
|
||||
DateTime DateModified { get; set; }
|
||||
string? UserModified { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
using System;
|
||||
|
||||
namespace Yavsc.Abstract.Interfaces
|
||||
{
|
||||
public interface IBatch<TInput, TOutput>
|
||||
{
|
||||
string WorkingDir { get; set; }
|
||||
|
||||
Action<TOutput> ResultHandler { get; }
|
||||
void Launch(TInput Input);
|
||||
string LogPath { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
namespace Yavsc.Services
|
||||
{
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Collections.Generic;
|
||||
using Yavsc.Abstract.Workflow;
|
||||
|
||||
public interface IBillingService
|
||||
{
|
||||
// TODO ensure a default value at using this:
|
||||
/// <summary>
|
||||
/// maps a command type name to a billing code, used to get bill assets
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Dictionary<string,string> BillingMap { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Renvoye la facture associée à une clé de facturation,
|
||||
/// à partir du couple suivant :
|
||||
///
|
||||
/// * un code de facturation
|
||||
/// (identifiant associé à un type de demande du client)
|
||||
/// * un entier long identifiant la demande du client
|
||||
/// (à une demande, on associe au maximum une seule facture)
|
||||
/// </summary>
|
||||
/// <param name="billingCode">Identifiant du type de facturation</param>
|
||||
/// <param name="queryId">Identifiant de la demande du client</param>
|
||||
/// <returns>La facture</returns>
|
||||
Task<IDecidableQuery> GetBillAsync(string billingCode, long queryId);
|
||||
|
||||
/// <summary>
|
||||
/// Perfomer settings for the specified performer in the activity
|
||||
/// </summary>
|
||||
/// <param name="activityCode">activityCode</param>
|
||||
/// <param name="userId">performer uid</param>
|
||||
/// <returns></returns>
|
||||
Task<IUserSettings> GetPerformersSettingsAsync(string activityCode, string userId);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
//
|
||||
// IIdentified.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paul@pschneider.fr>
|
||||
//
|
||||
// Copyright (c) 2015 GNU GPL
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
namespace Yavsc
|
||||
{
|
||||
/// <summary>
|
||||
/// I identified.
|
||||
/// </summary>
|
||||
public interface IIdentified<T>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the identifier.
|
||||
/// </summary>
|
||||
/// <value>The identifier.</value>
|
||||
T Id { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
//
|
||||
// ITitle.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paul@pschneider.fr>
|
||||
//
|
||||
// Copyright (c) 2015 GNU GPL
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
namespace Yavsc
|
||||
{
|
||||
public interface ITitle
|
||||
{
|
||||
string Title { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
using Yavsc.Abstract.Identity;
|
||||
|
||||
namespace Yavsc.Interfaces
|
||||
{
|
||||
public interface ICircleMember: IIdentified<long>
|
||||
{
|
||||
ICircle Circle { get; set; }
|
||||
IApplicationUser Member { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
namespace Yavsc.Interfaces
|
||||
{
|
||||
|
||||
public interface IComment<TReceiverId>
|
||||
{
|
||||
string Content { get; set; }
|
||||
TReceiverId ReceiverId { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
|
||||
using Yavsc.Abstract.Identity;
|
||||
|
||||
namespace Yavsc.Interfaces
|
||||
{
|
||||
public interface IGCMDeclaration
|
||||
{
|
||||
string DeviceId { get; set; }
|
||||
string GCMRegistrationId { get; set; }
|
||||
string Model { get; set; }
|
||||
string Platform { get; set; }
|
||||
string Version { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public interface IGoogleCloudMobileDeclaration: IGCMDeclaration
|
||||
{
|
||||
IApplicationUser DeviceOwner { get; set; }
|
||||
string DeviceOwnerId { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
namespace Yavsc.Interfaces
|
||||
{
|
||||
public interface ILocation
|
||||
{
|
||||
string Address { get; set; }
|
||||
long Id { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
namespace Yavsc.Interfaces
|
||||
{
|
||||
public interface INamedObject
|
||||
{
|
||||
string Name { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
namespace Yavsc.Interfaces
|
||||
{
|
||||
public interface IOwned
|
||||
{
|
||||
string OwnerId { get; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
namespace Yavsc.Interfaces
|
||||
{
|
||||
public interface IPosition
|
||||
{
|
||||
double Latitude { get; set; }
|
||||
double Longitude { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
namespace Yavsc.Interfaces
|
||||
{
|
||||
public interface ITaggable<K>
|
||||
{
|
||||
string [] GetTags();
|
||||
|
||||
K Id { get; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
using Yavsc.Billing;
|
||||
|
||||
namespace Yavsc.Models.Billing {
|
||||
public interface IBillingClause {
|
||||
string Description {get; set;}
|
||||
IBillingImpacter Impacter { get; }
|
||||
|
||||
// TODO
|
||||
// Conditions de ventes relatives à l'impact
|
||||
// IEnumerable<long> CGV,CPV
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
using System;
|
||||
using Yavsc.Abstract.Identity;
|
||||
|
||||
namespace Yavsc.Interfaces
|
||||
{
|
||||
public interface IBookQueryData
|
||||
{
|
||||
ClientProviderInfo Client { get; set; }
|
||||
DateTime EventDate { get; set; }
|
||||
long Id { get; set; }
|
||||
ILocation Location { get; set; }
|
||||
decimal? Previsionnal { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
namespace Yavsc.Interfaces
|
||||
{
|
||||
public interface IContact
|
||||
{
|
||||
string OwnerId { get; set; }
|
||||
string UserId { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
|
||||
MAKEFILE_DIR=../../scripts/make
|
||||
BASERESX=Resources/Yavsc.Attributes.Validation.Resources.resx \
|
||||
Resources/Yavsc.Models.Messaging.Resources.resx \
|
||||
Resources/Yavsc.Models.IT.Fixing.Bug.resx\
|
||||
Resources/Yavsc.ChatHubLabels.resx
|
||||
BASERESXGEN=$(BASERESX:.resx=.Designer.cs)
|
||||
include $(MAKEFILE_DIR)/dnx.mk
|
||||
include $(MAKEFILE_DIR)/versioning.mk
|
||||
|
||||
all: $(BASERESXGEN) $(BINTARGETPATH)
|
||||
|
||||
%.Designer.cs: %.resx
|
||||
strongresbuildercli -l -p -t -r "Yavsc.Abstract.Resources." $^
|
||||
|
||||
prepare_code: $(BASERESXGEN)
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
namespace Yavsc.Abstract.Manage
|
||||
{
|
||||
public class EmailSentViewModel
|
||||
{
|
||||
public string EMail { get; set; }
|
||||
public string MessageId { get; set; }
|
||||
public bool Sent { get; set; }
|
||||
public string ErrorMessage { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
|
||||
using Yavsc.Interfaces;
|
||||
|
||||
public class CommentPost : IComment<long>
|
||||
{
|
||||
public long ReceiverId { get; set; }
|
||||
public long? ParentId { get; set; }
|
||||
public string Content { get; set; }
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Interfaces;
|
||||
|
||||
namespace Yavsc.Models.Messaging
|
||||
{
|
||||
public interface IAnnounce : IOwned {
|
||||
Reason For { get; set; }
|
||||
string Message { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,73 +0,0 @@
|
|||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Abstract.Models.Messaging
|
||||
{
|
||||
/// <summary>
|
||||
/// A Notification, that mocks the one sent to Google,
|
||||
/// since it fits my needs
|
||||
/// </summary>
|
||||
public class Notification
|
||||
{
|
||||
[Key, DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
/// <summary>
|
||||
/// The title.
|
||||
/// </summary>
|
||||
[Required, Display(Name = "Titre")]
|
||||
[StringLength(1024)]
|
||||
public string title { get; set; }
|
||||
/// <summary>
|
||||
/// The body.
|
||||
/// </summary>
|
||||
[StringLength(512)]
|
||||
[Required, Display(Name = "Corps")]
|
||||
public string body { get; set; }
|
||||
/// <summary>
|
||||
/// The icon.
|
||||
/// </summary>
|
||||
[StringLength(512)]
|
||||
[Display(Name = "Icône")]
|
||||
public string? icon { get; set; }
|
||||
/// <summary>
|
||||
/// The sound.
|
||||
/// </summary>
|
||||
[StringLength(512)]
|
||||
[Display(Name = "Son")]
|
||||
public string? sound { get; set; }
|
||||
/// <summary>
|
||||
/// The tag.
|
||||
/// </summary>
|
||||
[StringLength(512)]
|
||||
[Display(Name = "Tag")]
|
||||
public string? tag { get; set; }
|
||||
/// <summary>
|
||||
/// The color.
|
||||
/// </summary>
|
||||
[StringLength(512)]
|
||||
[Display(Name = "Couleur")]
|
||||
public string? color { get; set; }
|
||||
/// <summary>
|
||||
/// The click action.
|
||||
/// </summary>
|
||||
[StringLength(512)]
|
||||
[Required, Display(Name = "Label du click")]
|
||||
public string click_action { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// When null, this must be seen by everynone.
|
||||
/// <c>user/{UserId}<c> : it's for this user, and only this one, specified by ID,
|
||||
/// <c>pub/cga</c> : the public "cga" topic
|
||||
/// <c>administration</c> : for admins ...
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[StringLength(512)]
|
||||
public string? Target { get; set; }
|
||||
|
||||
public Notification()
|
||||
{
|
||||
icon = "exclam";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
namespace Yavsc
|
||||
{
|
||||
public static class NotificationTypes {
|
||||
public const string Connected = "connected";
|
||||
public const string DisConnected = "disconnected";
|
||||
public const string Reconnected = "reconnected";
|
||||
public const string UserPart = "userpart";
|
||||
public const string UserJoin = "userjoin";
|
||||
public const string Kick = "kick";
|
||||
public const string Ban = "ban";
|
||||
public const string KickBan = "kickban";
|
||||
public const string Gline = "gline";
|
||||
public const string PrivateMessageDenied = "denied_pv";
|
||||
public const string Error = "error";
|
||||
public const string ContactRefused = "contact_refused";
|
||||
public const string ExistingUserName ="existing_user_name";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
namespace Yavsc.Models.Messaging
|
||||
{
|
||||
public class PublicStreamInfo
|
||||
{
|
||||
public long id { get; set; }
|
||||
public string sender { get; set; }
|
||||
public string title { get; set; }
|
||||
public string url { get; set; }
|
||||
public string mediaType { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
//
|
||||
// BookQueryEvent.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paul@pschneider.fr>
|
||||
//
|
||||
// Copyright (c) 2015-2016 GNU GPL
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
namespace Yavsc.Models.Messaging
|
||||
{
|
||||
using Interfaces.Workflow;
|
||||
using Yavsc.Abstract.Messaging;
|
||||
|
||||
public class RdvQueryEvent: RdvQueryProviderInfo, IEvent
|
||||
{
|
||||
public string SubTopic
|
||||
{
|
||||
get; private set;
|
||||
}
|
||||
|
||||
public RdvQueryEvent(string subTopic)
|
||||
{
|
||||
Topic = Topics.RdvQuery;
|
||||
SubTopic = subTopic;
|
||||
}
|
||||
|
||||
public string Sender
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public string Topic
|
||||
{
|
||||
get; private set;
|
||||
}
|
||||
|
||||
public string CreateBody()
|
||||
{
|
||||
return string.Format(Resources.RdvToPerf,
|
||||
Client.UserName,
|
||||
EventDate?.ToString("dddd dd/MM/yyyy à HH:mm"),
|
||||
Location.Address,
|
||||
ActivityCode);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
using System;
|
||||
using Yavsc.Abstract.Identity;
|
||||
using Yavsc.Models.Relationship;
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
|
||||
public class RdvQueryProviderInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// User querying
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public ClientProviderInfo Client { get; set; }
|
||||
public Location Location { get; set; }
|
||||
public long Id { get; set; }
|
||||
public DateTime? EventDate { get; set; }
|
||||
public decimal? Previsional { get; set; }
|
||||
public string Reason { get; set; }
|
||||
public string ActivityCode { get; set; }
|
||||
public string BillingCode { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
namespace Yavsc.Models.Messaging
|
||||
{
|
||||
public enum Reason : byte
|
||||
{
|
||||
Private,
|
||||
Corporate,
|
||||
SearchingAPro,
|
||||
Selling,
|
||||
Buying,
|
||||
ServiceProposal
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
namespace Yavsc.Abstract.Messaging
|
||||
{
|
||||
public static class Topics {
|
||||
public static readonly string General = "/topic/general";
|
||||
public static readonly string RdvQuery = "/topic/RdvQuery";
|
||||
public static readonly string Estimation = "/topic/Estimation";
|
||||
public static readonly string HairCutQuery = "/topic/HairCutQuery";
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Attributes.Validation;
|
||||
|
||||
namespace Yavsc.Models.Relationship
|
||||
{
|
||||
|
||||
public class Location : Position, ILocation {
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
[YaRequired(),
|
||||
Display(Name="Address"),
|
||||
MaxLength(512)]
|
||||
public string Address { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using Yavsc.Attributes.Validation;
|
||||
|
||||
namespace Yavsc.Models.Relationship
|
||||
{
|
||||
/// <summary>
|
||||
/// Position.
|
||||
/// </summary>
|
||||
public class Position: IPosition
|
||||
{
|
||||
/// <summary>
|
||||
/// The longitude.
|
||||
/// </summary>
|
||||
[YaRequired(),Display(Name="Longitude")]
|
||||
[Range(-180, 360.0)]
|
||||
|
||||
public double Longitude { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The latitude.
|
||||
/// </summary>
|
||||
[YaRequired(),Display(Name="Latitude")]
|
||||
[Range(-90, 90 )]
|
||||
public double Latitude { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Yavsc.Models.IT.Fixing {
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
public partial class Bug {
|
||||
|
||||
private static System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
public static System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.Equals(null, resourceMan)) {
|
||||
System.Resources.ResourceManager temp = new System.Resources.ResourceManager(("Yavsc.Abstract.Resources." + "Yavsc.Models.IT.Fixing.Bug"), typeof(Bug).GetTypeInfo().Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
public static System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
public static string TitleSizeError {
|
||||
get {
|
||||
return ResourceManager.GetString("TitleSizeError", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
public static string DescSizeError {
|
||||
get {
|
||||
return ResourceManager.GetString("DescSizeError", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Yavsc.Models.Messaging {
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
public partial class Resources {
|
||||
|
||||
private static System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
public static System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.Equals(null, resourceMan)) {
|
||||
System.Resources.ResourceManager temp = new System.Resources.ResourceManager(("Yavsc.Abstract.Resources." + "Yavsc.Models.Messaging.Resources"), typeof(Resources).GetTypeInfo().Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
public static System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
public static string RdvToPerf {
|
||||
get {
|
||||
return ResourceManager.GetString("RdvToPerf", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
// ------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Mono Runtime Version: 4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
// ------------------------------------------------------------------------------
|
||||
|
||||
namespace Yavsc.Attributes.Validation {
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
public partial class Resources {
|
||||
|
||||
private static System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
public static System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.Equals(null, resourceMan)) {
|
||||
System.Resources.ResourceManager temp = new System.Resources.ResourceManager(("Yavsc.Abstract.Resources." + "Yavsc.Attributes.Validation.Resources"), typeof(Resources).GetTypeInfo().Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
public static System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
public static string FieldRequired {
|
||||
get {
|
||||
return ResourceManager.GetString("FieldRequired", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
public static string InvalidStringLength {
|
||||
get {
|
||||
return ResourceManager.GetString("InvalidStringLength", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
public static string InvalidPath {
|
||||
get {
|
||||
return ResourceManager.GetString("InvalidPath", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,67 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<!--
|
||||
route name for the api controller used to tag the 'BlogPost' entity
|
||||
-->
|
||||
<data name="FieldRequired"><value>Please, fill in this field</value></data>
|
||||
<data name="InvalidStringLength"><value>Invalid string length ({0}..{1})</value></data>
|
||||
<data name="InvalidPath"><value>Invalid file path</value></data>
|
||||
</root>
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue