@guimabdo/webtyped
WebTyped is a tool for generating strongly typed TypeScript code from your http://ASP.NET or http://ASP.NET/core Web Apis.
Last updated 6 months ago by guimabdo .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @guimabdo/webtyped 
SYNC missed versions from official npm registry.

Build Status

WebTyped Latest version

WebTyped is a tool for generating strongly typed TypeScript code from your http://ASP.NET or http://ASP.NET/core Web Apis.

Quick Start

npm install @guimabdo/webtyped -g
npm install @guimabdo/webtyped-common

Create a webtyped.json configuration file in your project. Example:

{
	"files": [
		"../Controllers/**/*.cs",
		"../Models/**/*.cs"
	]
}

At the command line, run webtyped:

webtyped

Or use 'watch' option for generating typescript code and start watching cs files:

webtyped watch

Use generated services wherever you want:

import { MyService } from './webtyped/<services-folder>';
import { WebTypedFetchInvoker } from "@guimabdo/webtyped-common";

let inv = new WebTypedFetchInvoker(<api-base-url>);
let myService = new MyService(inv); //Generated from MyController.cs
myService.get().then(result => console.log(result));

Angular

npm install @guimabdo/webtyped-angular

webtyped.json

{
	"files": [
		"../Controllers/**/*.cs",
		"../Models/**/*.cs"
	],
	"inject": {
		"beforeServiceClass": [
			"import { Injectable } from '@angular/core';",
			"@Injectable({ providedIn: 'root' })"
		]
	},
}

Import the generated module and inject services when needed:

app.module.ts


import { WebTypedNgModule } from '@guimabdo/webtyped-angular';
@NgModule({
	imports: [
		WebTypedNgModule.forRoot()
	],
	//Optionally set api base. Default is './'
	providers: [
		{
			provide: 'API_BASE_URL',
			useValue: '<url>'
		}
	]
})
export class AppModule {}

Usage:

some.component.ts (for example)

import { MyService } from './webtyped/<services-folder>';
@Component({...})
export class SomeComponent {
	constructor(myService: MyService){}
}

Requirements

netcore 2.0 on dev machine

Current Tags

  • 0.25.0-info                                ...           'info' (2 years ago)
  • 0.29.0-dev.171                                ...           dev (7 months ago)
  • 0.30.0-dev.8                                ...           latest (6 months ago)

106 Versions

  • 0.30.0-dev.8                                ...           6 months ago
  • 0.30.0-dev.7                                ...           6 months ago
  • 0.30.0-dev.6                                ...           6 months ago
  • 0.30.0-dev.5                                ...           6 months ago
  • 0.30.0-dev.4                                ...           6 months ago
  • 0.30.0-dev.3                                ...           6 months ago
  • 0.30.0-dev.2                                ...           6 months ago
  • 0.30.0-dev.1                                ...           6 months ago
  • 0.30.0-dev.0                                ...           6 months ago
  • 0.29.1                                ...           6 months ago
  • 0.29.1-dev.4                                ...           6 months ago
  • 0.29.0                                ...           6 months ago
  • 0.29.1-dev.3                                ...           7 months ago
  • 0.29.1-dev.2                                ...           7 months ago
  • 0.29.1-dev.1                                ...           7 months ago
  • 0.29.0-dev.171                                ...           7 months ago
  • 0.29.0-dev.170                                ...           7 months ago
  • 0.29.0-dev.169                                ...           7 months ago
  • 0.29.0-dev.168                                ...           7 months ago
  • 0.29.0-dev.160                                ...           9 months ago
  • 0.29.0-dev.159                                ...           9 months ago
  • 0.29.0-dev.158                                ...           9 months ago
  • 0.28.0                                ...           9 months ago
  • 0.28.0-dev.155                                ...           9 months ago
  • 0.28.0-dev.154                                ...           10 months ago
  • 0.28.0-dev.153                                ...           10 months ago
  • 0.28.0-dev.152                                ...           a year ago
  • 0.28.0-dev.151                                ...           a year ago
  • 0.28.0-dev.150                                ...           a year ago
  • 0.28.0-dev.149                                ...           a year ago
  • 0.28.0-dev.148                                ...           a year ago
  • 0.28.0-dev.147                                ...           a year ago
  • 0.28.0-dev.140                                ...           a year ago
  • 0.28.0-dev.139                                ...           a year ago
  • 0.27.2                                ...           a year ago
  • 0.27.1-dev.136                                ...           a year ago
  • 0.27.1-dev.135                                ...           a year ago
  • 0.27.1-dev.134                                ...           a year ago
  • 0.27.1-dev.133                                ...           a year ago
  • 0.27.0                                ...           a year ago
  • 0.27.1-dev.132                                ...           a year ago
  • 0.27.1-dev.131                                ...           a year ago
  • 0.27.0-dev.129                                ...           a year ago
  • 0.27.0-dev.128                                ...           a year ago
  • 0.27.0-dev.127                                ...           a year ago
  • 0.27.0-dev.126                                ...           a year ago
  • 0.27.0-dev.125                                ...           a year ago
  • 0.27.0-dev.124                                ...           a year ago
  • 0.27.0-dev.123                                ...           a year ago
  • 0.27.0-dev.122                                ...           a year ago
  • 0.27.0-dev.121                                ...           a year ago
  • 0.27.0-dev.120                                ...           a year ago
  • 0.27.0-dev.119                                ...           a year ago
  • 0.27.0-dev.118                                ...           a year ago
  • 0.27.0-dev.117                                ...           a year ago
  • 0.27.0-dev.116                                ...           a year ago
  • 0.27.0-dev.115                                ...           a year ago
  • 0.27.0-dev.114                                ...           a year ago
  • 0.27.0-dev.113                                ...           a year ago
  • 0.27.0-dev.112                                ...           a year ago
  • 0.27.0-dev.109                                ...           2 years ago
  • 0.27.0-dev.108                                ...           2 years ago
  • 0.27.0-dev.107                                ...           2 years ago
  • 0.26.0                                ...           2 years ago
  • 0.26.0-dev.105                                ...           2 years ago
  • 0.26.0-dev.104                                ...           2 years ago
  • 0.26.0-dev.103                                ...           2 years ago
  • 0.26.0-dev.102                                ...           2 years ago
  • 0.26.0-dev.101                                ...           2 years ago
  • 0.26.0-dev.100                                ...           2 years ago
  • 0.26.0-dev.99                                ...           2 years ago
  • 0.26.0-dev.98                                ...           2 years ago
  • 0.26.0-dev.97                                ...           2 years ago
  • 0.26.0-dev.96                                ...           2 years ago
  • 0.26.0-dev.95                                ...           2 years ago
  • 0.26.0-dev.94                                ...           2 years ago
  • 0.26.0-dev.93                                ...           2 years ago
  • 0.26.0-dev.92                                ...           2 years ago
  • 0.26.0-dev.91                                ...           2 years ago
  • 0.26.0-dev.90                                ...           2 years ago
  • 0.26.0-dev.81                                ...           2 years ago
  • 0.26.0-dev.80                                ...           2 years ago
  • 0.26.0-dev.76                                ...           2 years ago
  • 0.26.0-dev.75                                ...           2 years ago
  • 0.26.0-dev.49                                ...           2 years ago
  • 0.25.0-info                                ...           2 years ago
  • 0.25.0                                ...           2 years ago
  • 0.25.0-dev.47                                ...           2 years ago
  • 0.25.0-dev.46                                ...           2 years ago
  • 0.25.0-dev.45                                ...           2 years ago
  • 0.25.0-dev.44                                ...           2 years ago
  • 0.25.0-dev.43                                ...           2 years ago
  • 0.25.0-dev.42                                ...           2 years ago
  • 0.25.0-dev.41                                ...           2 years ago
  • 0.25.0-dev.40                                ...           2 years ago
  • 0.25.0-dev.39                                ...           2 years ago
  • 0.25.0-dev.38                                ...           2 years ago
  • 0.25.0-dev.37                                ...           2 years ago
  • 0.25.0-dev.36                                ...           2 years ago
  • 0.25.0-dev.35                                ...           2 years ago
  • 0.25.0-dev.33                                ...           2 years ago
  • 0.25.0-dev.32                                ...           2 years ago
  • 0.25.0-dev.31                                ...           2 years ago
  • 0.25.0-dev.30                                ...           2 years ago
  • 0.25.0-dev.23                                ...           2 years ago
  • 0.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 106
This Month 106
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |