Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions js/tweek-local-cache/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tweek-local-cache",
"version": "0.3.0",
"version": "0.4.0",
"description": "Local cache to be used with tweek-client",
"author": "Soluto",
"license": "MIT",
Expand Down Expand Up @@ -33,7 +33,7 @@
"simple-fake-server": "^2.1.3",
"sinon": "^7.2.2",
"ts-node": "^7.0.1",
"tweek-client": "^0.1.9",
"tweek-client": "^0.2.0",
"typescript": "^3.2.2",
"wait-port": "^0.2.2"
},
Expand Down
6 changes: 3 additions & 3 deletions js/tweek-local-cache/src/tweek-repository.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ITweekClient, Context, FetchConfig } from 'tweek-client';
import { ConfiguraitonApi } from '../../../v2-clients/clients/typescript';
import { createChangeEmitter } from 'change-emitter';
import Observable = require('zen-observable');
import $$observable from 'symbol-observable';
Expand Down Expand Up @@ -46,7 +46,7 @@ export default class TweekRepository {
private _emitter = createChangeEmitter();
private _cache = new Trie<RepositoryKey<any>>(TweekKeySplitJoin);
private _store: ITweekStore;
private _client: ITweekClient;
private _client: ConfiguraitonApi;
private _context: Context = {};
private _getPolicy: GetPolicy;
private _refreshDelay: number;
Expand Down Expand Up @@ -275,7 +275,7 @@ export default class TweekRepository {
};

return this._client
.fetch<any>('_', fetchConfig)
.getValue('_', keysToRefresh, true)
.catch(err => {
expiredKeys.forEach(([key, valueNode]) =>
this._cache.set(key, {
Expand Down
4 changes: 2 additions & 2 deletions js/tweek-local-cache/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ITweekClient } from 'tweek-client';
import { KeysApi } from '../../../v2-clients/clients/typescript';

export type TweekRepositoryKeys = {
[key: string]: RepositoryKey<any>;
Expand Down Expand Up @@ -42,7 +42,7 @@ export type ScanNode = {
export type RepositoryKey<T> = CachedKey<T> | RequestedKey | ScanNode | MissingKey;

export type TweekRepositoryConfig = {
client: ITweekClient;
client: KeysApi;
getPolicy?: GetPolicy;
refreshInterval?: number;
refreshDelay?: number;
Expand Down
1 change: 1 addition & 0 deletions v2-clients/client-generator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- ./createClients.bash swagger/file/path/swagger.yml out/put/path
24 changes: 24 additions & 0 deletions v2-clients/client-generator/createClients.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
realpath () {
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
}

createClient () {
docker run --rm -v ${swaggerDirectory}:/swaggerDirectory -v ${outputPath}:/outputPath openapitools/openapi-generator-cli:v4.0.0-beta generate -i /swaggerDirectory/$swaggerFilename -g $1 -o outputPath/clients/$1
}
swaggerFilePath=$(realpath $1)
swaggerDirectory=$(dirname $swaggerFilePath)
swaggerFilename=$(basename $swaggerFilePath)
outputPath=$(realpath $2)
thisPath=$(realpath ./)


# generate clients

createClient typescript-axios
createClient java
createClient go

# csharp
docker run --rm -v ${swaggerDirectory}:/swaggerDirectory -v ${outputPath}:/outputPath -v ${thisPath}:/configPath openapitools/openapi-generator-cli:v4.0.0-beta generate -i /swaggerDirectory/$swaggerFilename -g csharp -o outputPath/clients/csharp -c /configPath/csharp-configuration.yaml

createClient swift
4 changes: 4 additions & 0 deletions v2-clients/client-generator/csharp-configuration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"targetFramework": "v5.0",
"netCoreProjectFile": true
}
186 changes: 186 additions & 0 deletions v2-clients/clients/csharp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
# Ref: https://gist.github.com/kmorcinek/2710267
# Download this file using PowerShell v3 under Windows with the following comand
# Invoke-WebRequest https://gist.githubusercontent.com/kmorcinek/2710267/raw/ -OutFile .gitignore

# User-specific files
*.suo
*.user
*.sln.docstates
./nuget

# Build results

[Dd]ebug/
[Rr]elease/
x64/
build/
[Bb]in/
[Oo]bj/

# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.log
*.scc

# OS generated files #
.DS_Store*
ehthumbs.db
Icon?
Thumbs.db

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile

# Visual Studio profiler
*.psess
*.vsp
*.vspx

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
*.ncrunch*
.*crunch*.local.xml

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.Publish.xml

# Windows Azure Build Output
csx
*.build.csdef

# Windows Store app package directory
AppPackages/

# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.[Pp]ublish.xml
*.pfx
*.publishsettings
modulesbin/
tempbin/

# EPiServer Site file (VPP)
AppData/

# RIA/Silverlight projects
Generated_Code/

# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# vim
*.txt~
*.swp
*.swo

# svn
.svn

# SQL Server files
**/App_Data/*.mdf
**/App_Data/*.ldf
**/App_Data/*.sdf


#LightSwitch generated files
GeneratedArtifacts/
_Pvt_Extensions/
ModelManifest.xml

# =========================
# Windows detritus
# =========================

# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Mac desktop service store files
.DS_Store

# SASS Compiler cache
.sass-cache

# Visual Studio 2014 CTP
**/*.sln.ide
23 changes: 23 additions & 0 deletions v2-clients/clients/csharp/.openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator

# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.

# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux

# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux

# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
1 change: 1 addition & 0 deletions v2-clients/clients/csharp/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4.0.0-beta
25 changes: 25 additions & 0 deletions v2-clients/clients/csharp/Org.OpenAPITools.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{6520E596-CD23-4DC1-B27A-5BD0CB7F0FDF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6520E596-CD23-4DC1-B27A-5BD0CB7F0FDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6520E596-CD23-4DC1-B27A-5BD0CB7F0FDF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6520E596-CD23-4DC1-B27A-5BD0CB7F0FDF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6520E596-CD23-4DC1-B27A-5BD0CB7F0FDF}.Release|Any CPU.Build.0 = Release|Any CPU
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Loading