Skip to content

Commit a4c2c76

Browse files
authored
Merge pull request #20 from microsoftgraph/typings-to-types
Migrating away from typings in sdk core and TypeScript sample
2 parents 56ff6be + 0452894 commit a4c2c76

File tree

12 files changed

+25
-47
lines changed

12 files changed

+25
-47
lines changed

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[![npm version badge](https://img.shields.io/npm/v/msgraph-sdk-javascript.svg?maxAge=86400)](https://www.npmjs.com/package/msgraph-sdk-javascript)
33
[![Travis](https://img.shields.io/travis/microsoftgraph/msgraph-sdk-javascript.svg?maxAge=2592000?style=flat-square)](https://travis-ci.org/microsoftgraph/msgraph-sdk-javascript)
44

5-
The Microsoft Graph JavaScript SDK is a lightweight wrapper around the Microsoft Graph API that supports both Node and the browser. See the [samples](samples) folder for code examples. You can also use our [TypeScript graph typings](https://github.com/microsoftgraph/msgraph-typescript-typings) with this SDK.
5+
The Microsoft Graph JavaScript SDK is a lightweight wrapper around the Microsoft Graph API that supports both Node and the browser. See the [samples](samples) folder for code examples. You can also use our [TypeScript graph types](https://github.com/microsoftgraph/msgraph-typescript-typings) with this SDK.
66

77
> This SDK is currently in preview and we would love to hear your feedback! You can file an issue in this repository or write on our [uservoice page](https://officespdev.uservoice.com/). We're also trying to add more intellisense support beyond the current typings so we're also especially interested in feedback on the [Microsoft Graph TypeScript Typings](https://github.com/microsoftgraph/msgraph-typescript-typings).
88
@@ -21,6 +21,9 @@ Include [lib/graph-js-sdk-web.js](https://github.com/microsoftgraph/msgraph-sdk-
2121
<script type="text/javascript" src="graph-js-sdk-web.js"></script>
2222
```
2323
## Changelog
24+
#### 0.3.0
25+
* Migrated away from typings in sdk core and TypeScript sample
26+
2427
#### 0.2.2
2528
* Updated SuperAgent to version ``` 3.3.0 ```
2629

@@ -314,7 +317,7 @@ These steps are not required to use this SDK.
314317
315318
```npm run build``` generates lib/ files for node and browser versions.
316319

317-
```npm pack``` bundles the npm module. This will automatically run ```typings install```.
320+
```npm pack``` bundles the npm module.
318321

319322
```npm test``` runs tests.
320323

@@ -334,7 +337,7 @@ Please see the [contributing guidelines](CONTRIBUTING.md).
334337
## Additional resources
335338

336339
* [Microsoft Graph website](https://graph.microsoft.io)
337-
* [Microsoft Graph TypeScript typings](https://github.com/microsoftgraph/msgraph-typescript-typings/)
340+
* [Microsoft Graph TypeScript types](https://github.com/microsoftgraph/msgraph-typescript-typings/)
338341
* [Angular.js sample using the JavaScript SDK](https://github.com/microsoftgraph/angular-connect-sample)
339342
* [Node.js sample using the JavaScript SDK](https://github.com/microsoftgraph/nodejs-connect-sample)
340343
* [Office Dev Center](http://dev.office.com/)

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "msgraph-sdk-javascript",
3-
"version": "0.2.2",
3+
"version": "0.3.0",
44
"description": "Microsoft Graph JavaScript SDK",
55
"main": "lib/src/index.js",
66
"typings": "lib/src/index",
@@ -9,13 +9,13 @@
99
],
1010
"types": "./lib/src/index.d.ts",
1111
"devDependencies": {
12-
"typescript": "^2.0",
12+
"@types/superagent": "^2.0.36",
13+
"@types/mocha": "^2.2.34",
1314
"browserify": "^13.1.0",
14-
"mocha": "^3.0.2",
15-
"typings": "^2.0.0"
15+
"mocha": "^3.2.0",
16+
"typescript": "^2.1"
1617
},
1718
"scripts": {
18-
"prepublish": "typings install",
1919
"build": "tsc && node node-browserify.js > lib/graph-js-sdk-web.js",
2020
"test": "mocha lib/test"
2121
},

samples/typescript/package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "typescript-sample",
3+
"version": "0.2.2",
4+
"description": "TypeScript Sample",
5+
"devDependencies": {
6+
"msgraph-types": "https://github.com/microsoftgraph/msgraph-typescript-typings.git",
7+
"typescript": "^2.1"
8+
}
9+
}

samples/typescript/sample.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/// <reference path="../../typings/index.d.ts" />
2-
31
// For more samples in JavaScript, see https://github.com/microsoftgraph/msgraph-sdk-javascript/blob/master/samples/node/node-sample.js
42

53
const secrets = require("../node/secrets");
@@ -8,11 +6,10 @@ const secrets = require("../node/secrets");
86

97
import {Client as GraphClient} from "../../lib/src/index";
108

11-
12-
// These are the typings for graph nodes that are published separetlely (User field types, etc.)
13-
// To reference Microsoft Graph typings, see directions at https://github.com/microsoftgraph/msgraph-typescript-typings/
14-
// The dependency has been added in typings.json, so just run typings install
15-
import * as MicrosoftGraph from "microsoft-graph"
9+
// These are the types for graph nodes that are published separetlely (User field types, messages, contacts, etc.)
10+
// To reference Microsoft Graph types, see directions at https://github.com/microsoftgraph/msgraph-typescript-typings/
11+
// The dependency has been added in package.json, so just run npm install
12+
import * as MicrosoftGraph from "microsoft-graph-typings"
1613

1714

1815
const client = GraphClient.init({

samples/typescript/typings.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/GraphRequest.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/// <reference path="../typings/index.d.ts" />
2-
31
import {Options, URLComponents, GraphError, oDataQueryNames, GraphRequestCallback} from "./common"
42
import * as request from 'superagent';
53

src/common.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/// <reference path="../typings/index.d.ts" />
2-
31
export const oDataQueryNames = ["$select", "$expand", "$orderby", "$filter", "$top", "$skip", "$skipToken", "$count"];
42
export const DEFAULT_VERSION = "v1.0";
53
export const GRAPH_BASE_URL = "https://graph.microsoft.com/";

src/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
/// <reference path="../typings/index.d.ts" />
2-
'use strict';
3-
41
import * as request from 'superagent';
52

63
import {Options, DEFAULT_VERSION, GRAPH_BASE_URL} from "./common"

test/responseHandling.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
/// <reference path="../typings/index.d.ts" />
2-
31
import {ResponseHandler} from "../src/ResponseHandler"
42
import {GraphError} from '../src/common'
3+
import * as mocha from 'mocha'
54

65
import * as assert from 'assert';
76

test/urlGeneration.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/// <reference path="../typings/index.d.ts" />
2-
31
import * as assert from 'assert';
42

53
import {Client as GraphClient} from "../src/index"

0 commit comments

Comments
 (0)