Skip to content

Commit

Permalink
feature: commit auto generated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pawel-id committed Jan 6, 2024
1 parent 140054f commit 1ce2a01
Show file tree
Hide file tree
Showing 8 changed files with 320 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/.nojekyll
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.
9 changes: 9 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# bir1

## Modules

- [\<internal\>](modules/internal_.md)

## Classes

- [Bir](classes/Bir.md)
177 changes: 177 additions & 0 deletions docs/classes/Bir.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
# Class: Bir

Class Bir provides access to REGON API

**`Example`**

```js
import Bir from 'bir1'
const bir = new Bir()
await bir.login()
console.log(await bir.search({ nip: '5261040567' }))
// output:
// {
// regon: '011417295',
// nip: '5261040567',
// statusNip: '',
// nazwa: 'T-MOBILE POLSKA SPÓŁKA AKCYJNA',
// ...
// }
```

## Constructors

### constructor

**new Bir**(`options?`): [`Bir`](Bir.md)

Create a new Bir instance

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `options` | `Object` | - |
| `options.key?` | `string` | API key provided by GUS. **`Remarks`** If `options.key` is not provided, the internally stored public API key is used to access non-production GUS database. It allows quick start, however non-production database contains old and anonymized data. Providing GUS provided key connects to the production database. |
| `options.parseOptions?` | [`ParseOptions`](../interfaces/internal_.ParseOptions.md) | Additional parse options for XML parser |

#### Returns

[`Bir`](Bir.md)

#### Defined in

[bir.ts:53](https://github.com/pawel-id/bir1/blob/140054f/src/bir.ts#L53)

## Methods

### login

**login**(): `Promise`\<`void`\>

Login to the API (method: Zaloguj)

#### Returns

`Promise`\<`void`\>

**`Remarks`**

This method must be called before any other method. It is not called
automatically to allow for more control over the login process.

#### Defined in

[bir.ts:113](https://github.com/pawel-id/bir1/blob/140054f/src/bir.ts#L113)

___

### value

**value**(`value`): `Promise`\<`string`\>

Get diagnostic information (method: GetValue)

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `value` | [`GetValueOptions`](../modules/internal_.md#getvalueoptions) | value to retrieve |

#### Returns

`Promise`\<`string`\>

#### Defined in

[bir.ts:126](https://github.com/pawel-id/bir1/blob/140054f/src/bir.ts#L126)

___

### search

**search**(`query`): `Promise`\<`any`\>

Search (method: DaneSzukajPodmioty)

#### Parameters

| Name | Type |
| :------ | :------ |
| `query` | \{ `nip`: `string` } \| \{ `regon`: `string` } \| \{ `krs`: `string` } |

#### Returns

`Promise`\<`any`\>

**`Remarks`**

Only one of the query parameters can be used at a time.

#### Defined in

[bir.ts:142](https://github.com/pawel-id/bir1/blob/140054f/src/bir.ts#L142)

___

### report

**report**(`query`): `Promise`\<`any`\>

Retrive report (method: DanePobierzPelnyRaport)

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `query` | `Object` | - |
| `query.regon` | `string` | REGON number |
| `query.report` | [`DanePobierzPelnyRaportOptions`](../modules/internal_.md#danepobierzpelnyraportoptions) | report name |

#### Returns

`Promise`\<`any`\>

#### Defined in

[bir.ts:153](https://github.com/pawel-id/bir1/blob/140054f/src/bir.ts#L153)

___

### summary

**summary**(`query`): `Promise`\<`any`\>

Retrive summary report (method: DanePobierzRaportZbiorczy)

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `query` | `Object` | - |
| `query.date` | `string` | date in format YYYY-MM-DD not earlier than week before |
| `query.report` | [`DanePobierzRaportZbiorczyOptions`](../modules/internal_.md#danepobierzraportzbiorczyoptions) | report name |

#### Returns

`Promise`\<`any`\>

#### Defined in

[bir.ts:167](https://github.com/pawel-id/bir1/blob/140054f/src/bir.ts#L167)

___

### logout

**logout**(): `Promise`\<`void`\>

Logout (method: Wyloguj)

#### Returns

`Promise`\<`void`\>

#### Defined in

[bir.ts:179](https://github.com/pawel-id/bir1/blob/140054f/src/bir.ts#L179)
43 changes: 43 additions & 0 deletions docs/classes/internal_.Xml.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Class: Xml

[\<internal\>](../modules/internal_.md).Xml

## Constructors

### constructor

**new Xml**(`options?`): [`Xml`](internal_.Xml.md)

#### Parameters

| Name | Type |
| :------ | :------ |
| `options` | `Partial`\<[`ParseOptions`](../interfaces/internal_.ParseOptions.md)\> |

#### Returns

[`Xml`](internal_.Xml.md)

#### Defined in

[xml.ts:62](https://github.com/pawel-id/bir1/blob/140054f/src/xml.ts#L62)

## Methods

### parse

**parse**(`xml`): `any`

#### Parameters

| Name | Type |
| :------ | :------ |
| `xml` | `string` |

#### Returns

`any`

#### Defined in

[xml.ts:74](https://github.com/pawel-id/bir1/blob/140054f/src/xml.ts#L74)
33 changes: 33 additions & 0 deletions docs/interfaces/internal_.ParseOptions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Interface: ParseOptions

[\<internal\>](../modules/internal_.md).ParseOptions

## Properties

### emptyTag

`Optional` **emptyTag**: [`EmptyTag`](../modules/internal_.md#emptytag)

When parsing XML the empty tags are replaced by '' - this is the default
behavior of fast-ml-parser. When this variable is set to any other value,
the empty tags are futher replaced by that value, overriding default ''.

#### Defined in

[xml.ts:14](https://github.com/pawel-id/bir1/blob/140054f/src/xml.ts#L14)

___

### xmlOptions

`Optional` **xmlOptions**: `Partial`\<`X2jOptions`\>

Additional parse options for XML parser. Any option of fast-xml-parser
can be used here. This object is passed to the constructor of
fast-xml-parser. Then parser is used to parse XML response from GUS.

See [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser/blob/HEAD/docs/v4/2.XMLparseOptions.md)

#### Defined in

[xml.ts:23](https://github.com/pawel-id/bir1/blob/140054f/src/xml.ts#L23)
55 changes: 55 additions & 0 deletions docs/modules/internal_.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Module: \<internal\>

## Classes

- [Xml](../classes/internal_.Xml.md)

## Interfaces

- [ParseOptions](../interfaces/internal_.ParseOptions.md)

## Type Aliases

### GetValueOptions

Ƭ **GetValueOptions**: ``"StanDanych"`` \| ``"KomunikatKod"`` \| ``"KomunikatTresc"`` \| ``"StatusSesji"`` \| ``"StatusUslugi"`` \| ``"KomunikatUslugi"``

Options for method `GetValue`.

#### Defined in

[types.ts:4](https://github.com/pawel-id/bir1/blob/140054f/src/types.ts#L4)

___

### DanePobierzPelnyRaportOptions

Ƭ **DanePobierzPelnyRaportOptions**: ``"PublDaneRaportFizycznaOsoba"`` \| ``"PublDaneRaportDzialalnoscFizycznejCeidg"`` \| ``"PublDaneRaportDzialalnoscFizycznejRolnicza"`` \| ``"PublDaneRaportDzialalnoscFizycznejPozostala"`` \| ``"PublDaneRaportDzialalnoscFizycznejWKrupgn"`` \| ``"PublDaneRaportDzialalnosciFizycznej"`` \| ``"PublDaneRaportLokalneFizycznej"`` \| ``"PublDaneRaportLokalnaFizycznej"`` \| ``"PublDaneRaportDzialalnosciLokalnejFizycznej"`` \| ``"PublDaneRaportPrawna"`` \| ``"PublDaneRaportDzialalnosciPrawnej"`` \| ``"PublDaneRaportLokalnePrawnej"`` \| ``"PublDaneRaportLokalnaPrawnej"`` \| ``"PublDaneRaportDzialalnosciLokalnejPrawnej"`` \| ``"PublDaneRaportWspolnicyPrawnej"`` \| ``"PublDaneRaportTypJednostki"`` \| ``"BIR11OsFizycznaDaneOgolne"`` \| ``"BIR11OsFizycznaDzialalnoscCeidg"`` \| ``"BIR11OsFizycznaDzialalnoscRolnicza"`` \| ``"BIR11OsFizycznaDzialalnoscPozostala"`` \| ``"BIR11OsFizycznaDzialalnoscSkreslonaDo20141108"`` \| ``"BIR11OsFizycznaPkd"`` \| ``"BIR11OsFizycznaListaJednLokalnych"`` \| ``"BIR11JednLokalnaOsFizycznej"`` \| ``"BIR11JednLokalnaOsFizycznejPkd"`` \| ``"BIR11OsPrawna"`` \| ``"BIR11OsPrawnaPkd"`` \| ``"BIR11OsPrawnaListaJednLokalnych"`` \| ``"BIR11JednLokalnaOsPrawnej"`` \| ``"BIR11JednLokalnaOsPrawnejPkd"`` \| ``"BIR11OsPrawnaSpCywilnaWspolnicy"`` \| ``"BIR11TypPodmiotu"``

Reports for method `DanePobierzPelnyRaport`.

#### Defined in

[types.ts:28](https://github.com/pawel-id/bir1/blob/140054f/src/types.ts#L28)

___

### DanePobierzRaportZbiorczyOptions

Ƭ **DanePobierzRaportZbiorczyOptions**: ``"BIR11NowePodmiotyPrawneOrazDzialalnosciOsFizycznych"`` \| ``"BIR11AktualizowanePodmiotyPrawneOrazDzialalnosciOsFizycznych"`` \| ``"BIR11SkreslonePodmiotyPrawneOrazDzialalnosciOsFizycznych"`` \| ``"BIR11NoweJednostkiLokalne"`` \| ``"BIR11AktualizowaneJednostkiLokalne"`` \| ``"BIR11SkresloneJednostkiLokalne"``

Reports for method `DanePobierzRaportZbiorczy`.

#### Defined in

[types.ts:65](https://github.com/pawel-id/bir1/blob/140054f/src/types.ts#L65)

___

### EmptyTag

Ƭ **EmptyTag**: `string` \| ``null`` \| `undefined`

#### Defined in

[xml.ts:5](https://github.com/pawel-id/bir1/blob/140054f/src/xml.ts#L5)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"templates"
],
"scripts": {
"build": "rimraf dist && tsc",
"build": "rimraf docs dist && typedoc && tsc",
"dev": "tsc -w",
"test": "tap"
},
Expand Down
2 changes: 1 addition & 1 deletion typedoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
"sort": ["source-order"],
"entryPoints": ["./src/"],
"readme": "none",
"out": "./doc"
"out": "./docs"
}

0 comments on commit 1ce2a01

Please sign in to comment.