Skip to content

Commit

Permalink
feat(typings): export runMigration function and options in typings
Browse files Browse the repository at this point in the history
fix(index.ts): add index.ts and make package.json refer to it in main field
  • Loading branch information
phoebeschmidt authored May 19, 2020
2 parents 210ccd5 + 589b27f commit e6902bf
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ npm install contentful-migration
### Usage as a library

```javascript
const runMigration = require('contentful-migration/built/bin/cli').runMigration
const { runMigration } = require('contentful-migration')
const options = {
filePath: '<migration-file-path>',
spaceId: '<space-id>',
Expand Down
11 changes: 11 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
import * as axios from 'axios'

export interface RunMigrationConfig {
filePath: string
accessToken?: string
spaceId?: string
environmentId?: string
proxy?: string
rawProxy?: boolean
}

export function runMigration (config: RunMigrationConfig): Promise<any>

export interface Movement {
toTheTop(): void
toTheBottom(): void
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Migration tooling for contentful",
"author": "Contentful GmbH",
"license": "MIT",
"main": "index",
"main": "built/index",
"keywords": [
"contentful",
"content model",
Expand Down
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { runMigration } from './bin/cli'

module.exports = { runMigration }

0 comments on commit e6902bf

Please sign in to comment.