Skip to content

Commit

Permalink
Renamed to @42.nl/spring-connect
Browse files Browse the repository at this point in the history
  • Loading branch information
MrHus committed Aug 6, 2019
1 parent 3d521c2 commit 9fb3a1c
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 24 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [3.1.2] - 2019-08-06

- Renamed to @42.nl/spring-connect

## [3.1.1] - 2019-07-16

- Upgraded `lodash.merge` to resolve vulnerability warnings.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This library makes it easy to create Resource to connect to a [Spring MVC](https

# Installation

`npm install mad-spring-connect --save`
`npm install @42.nl/spring-connect --save`

# Documentation

Expand Down
2 changes: 1 addition & 1 deletion docs/_config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
remote_theme: 42bv/fortytwo
title: 'mad-spring-connect'
title: '@42.nl/spring-connect'
description: 'Connecting with Spring REST APIs'
baseurl: /mad-spring-connect/
plugins:
Expand Down
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: default
title: Introduction
nav_order: 1
description: 'Documentation for mad-spring-connect.'
description: 'Documentation for @42.nl/spring-connect.'
has_children: true
permalink: /
---
Expand All @@ -23,5 +23,5 @@ has its own properties and extra methods. Trying to catch all these
differences via a _configuration_ based API is **_impossible_**. Using
code is more natural and easier to understand.

Therefore 'mad-spring-connect' allows you to define a Resource, with
Therefore '@42.nl/spring-connect' allows you to define a Resource, with
some bells and whistles, but allows you to customize it in code.
6 changes: 3 additions & 3 deletions docs/introduction/installation.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: default
title: Installation
description: 'Installation instructions for mad-spring-connect.'
description: 'Installation instructions for @42.nl/spring-connect.'
parent: Introduction
permalink: /installation
nav_order: 1
Expand All @@ -10,11 +10,11 @@ nav_order: 1
### With npm

```
npm install mad-spring-connect --save
npm install @42.nl/spring-connect --save
```

### Or with Yarn

```
yarn add mad-spring-connect
yarn add @42.nl/spring-connect
```
20 changes: 10 additions & 10 deletions docs/introduction/usage.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: default
title: Usage
description: 'Usage instructions for mad-spring-connect.'
description: 'Usage instructions for @42.nl/spring-connect.'
parent: Introduction
permalink: /usage
nav_order: 3
Expand All @@ -25,7 +25,7 @@ declare class BaseResource<T> {
Lets say we want to define a Pokemon resource, we do this like so:

```js
import { makeResource, Page } from 'mad-spring-connect';
import { makeResource, Page } from '@42.nl/spring-connect';

class Pokemon extends makeResource('api/pokemon')<Pokemon> {
// These are the properties of the pokemon
Expand Down Expand Up @@ -156,7 +156,7 @@ pokemon.save().then(() => {
Say you want to add method which retrieves all the evolutions of a pokemon, this is how you do it:

```js
import { get, makeInstance, makeResource } from 'mad-spring-connect';
import { get, makeInstance, makeResource } from '@42.nl/spring-connect';

class Pokemon extends makeResource('api/pokemon')<Pokemon> {
// shortend the definition of the pokemon class.
Expand Down Expand Up @@ -203,7 +203,7 @@ You can override `save` and `remove` by simply defining them.
This example defines its own custom `save` implementation:

```js
import { makeResource, post, put, Page } from 'mad-spring-connect';
import { makeResource, post, put, Page } from '@42.nl/spring-connect';
import { merge } from 'lodash';

class Pokemon extends makeResource('api/pokemon')<Pokemon> {
Expand Down Expand Up @@ -234,7 +234,7 @@ This example defines its own custom `one` implementation:

```js

import { makeResource, get, makeInstance, Page } from 'mad-spring-connect';
import { makeResource, get, makeInstance, Page } from '@42.nl/spring-connect';

// When a pokemon is retrieved in a page it has less info.
export interface PagePokemon {
Expand Down Expand Up @@ -280,7 +280,7 @@ The **_get_** function does a GET request to the given url, with the query param
For example:

```js
import { get } from 'mad-spring-connect';
import { get } from '@42.nl/spring-connect';

get('api/pokemon', { page: 1 }).then(json => {
// Do something with the json here
Expand Down Expand Up @@ -333,7 +333,7 @@ Then gives the result to the configured middleware
for processing.

```js
import { remove } from 'mad-spring-connect';
import { remove } from '@42.nl/spring-connect';

remove('api/pokemon/1').then(() => {
// Do something here.
Expand All @@ -349,7 +349,7 @@ as the properties of the class.
For example:

```js
import { makeInstance } from 'mad-spring-connect';
import { makeInstance } from '@42.nl/spring-connect';

class Person {
id: number;
Expand All @@ -374,7 +374,7 @@ configure two things, the middleware chain it uses and
you can set the `fetch` it uses.

```js
import { configureMadConnect, checkStatus, parseJSON } from 'mad-spring-connect';
import { configureMadConnect, checkStatus, parseJSON } from '@42.nl/spring-connect';

import { authFetch } from 'redux-mad-authentication';

Expand Down Expand Up @@ -489,7 +489,7 @@ Now all you need to do is to call `configureMadConnect` and
set the middleware:

```js
import { configureMadConnect, checkStatus, parseJSON } from 'mad-spring-connect';
import { configureMadConnect, checkStatus, parseJSON } from '@42.nl/spring-connect';

import { authFetch } from 'redux-mad-authentication';

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mad-spring-connect",
"version": "3.1.1",
"name": "@42.nl/spring-connect",
"version": "3.1.2",
"description": "Connecting with a Spring REST APIs in a domain friendly manner",
"files": [
"lib"
Expand Down
2 changes: 1 addition & 1 deletion src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export async function parseJSON(promise: Promise<Response>): Promise<any> {
}
const contentType = response.headers.get('Content-Type');
if (contentType === null || contentType.includes('json') === false) {
throw new Error('mad-spring-connect: Content-Type is not json, will not parse.');
throw new Error('@42.nl/spring-connect: Content-Type is not json, will not parse.');
}
return response.json();
}
Expand Down
4 changes: 2 additions & 2 deletions tests/middleware.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ describe('parseJSON', () => {
fail();
})
.catch(e => {
expect(e.message).toBe('mad-spring-connect: Content-Type is not json, will not parse.');
expect(e.message).toBe('@42.nl/spring-connect: Content-Type is not json, will not parse.');
done();
});
});
Expand All @@ -117,7 +117,7 @@ describe('parseJSON', () => {
fail();
})
.catch(e => {
expect(e.message).toBe('mad-spring-connect: Content-Type is not json, will not parse.');
expect(e.message).toBe('@42.nl/spring-connect: Content-Type is not json, will not parse.');
done();
});
});
Expand Down

0 comments on commit 9fb3a1c

Please sign in to comment.