Skip to content

Commit

Permalink
Version Packages (#29)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
manzoorwanijk and github-actions[bot] authored Aug 31, 2024
1 parent d84bbd2 commit f3cfc79
Show file tree
Hide file tree
Showing 11 changed files with 83 additions and 78 deletions.
5 changes: 0 additions & 5 deletions .changeset/poor-buttons-check.md

This file was deleted.

6 changes: 6 additions & 0 deletions packages/react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @telegram-auth/react Change Log

## 1.0.4

### Patch Changes

- [#28](https://github.com/manzoorwanijk/telegram-auth/pull/28) [`d84bbd2`](https://github.com/manzoorwanijk/telegram-auth/commit/d84bbd25374d4a40c9b0166c23c16487f05d97de) Thanks [@manzoorwanijk](https://github.com/manzoorwanijk)! - Fixed conditional rendering of login button

## 1.0.3

### Patch Changes
Expand Down
8 changes: 4 additions & 4 deletions packages/react/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ https://core.telegram.org/widgets/login

#### Defined in

[LoginButton.tsx:23](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/LoginButton.tsx#L23)
[LoginButton.tsx:23](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/LoginButton.tsx#L23)

___

### createScript

**createScript**(`options`): [`HTMLScriptElement`]( https://developer.mozilla.org/en-US/docs/Web/API/HTMLScriptElement )
**createScript**(`options`): [`HTMLScriptElement`]( https://developer.mozilla.org/docs/Web/API/HTMLScriptElement )

It creates a script tag with the right attributes to load the Telegram widget

Expand All @@ -59,7 +59,7 @@ It creates a script tag with the right attributes to load the Telegram widget

#### Returns

[`HTMLScriptElement`]( https://developer.mozilla.org/en-US/docs/Web/API/HTMLScriptElement )
[`HTMLScriptElement`]( https://developer.mozilla.org/docs/Web/API/HTMLScriptElement )

A script element

Expand All @@ -69,4 +69,4 @@ https://core.telegram.org/widgets/login

#### Defined in

[createScript.ts:11](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/createScript.ts#L11)
[createScript.ts:11](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/createScript.ts#L11)
22 changes: 11 additions & 11 deletions packages/react/docs/interfaces/CreateScriptOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ The username of the bot that will be used to authenticate the user.

#### Defined in

[types.ts:25](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L25)
[types.ts:25](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L25)

___

Expand All @@ -54,7 +54,7 @@ The URL where the auth data from Telegram will be sent.

#### Defined in

[types.ts:20](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L20)
[types.ts:20](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L20)

___

Expand All @@ -76,7 +76,7 @@ The size of the button.

#### Defined in

[types.ts:32](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L32)
[types.ts:32](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L32)

___

Expand All @@ -92,7 +92,7 @@ The radius of the button corners.

#### Defined in

[types.ts:37](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L37)
[types.ts:37](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L37)

___

Expand All @@ -114,20 +114,20 @@ The language of the button.

#### Defined in

[types.ts:44](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L44)
[types.ts:44](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L44)

___

### onAuthCallback

`Optional` **onAuthCallback**: (`data`: [`TelegramAuthData`](TelegramAuthData.md)) => `void`

The callback function that will be called when the user is authenticated.

#### Type declaration

▸ (`data`): `void`

The callback function that will be called when the user is authenticated.

##### Parameters

| Name | Type |
Expand All @@ -144,7 +144,7 @@ The callback function that will be called when the user is authenticated.

#### Defined in

[types.ts:49](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L49)
[types.ts:49](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L49)

___

Expand All @@ -166,7 +166,7 @@ The access level that the bot will request.

#### Defined in

[types.ts:56](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L56)
[types.ts:56](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L56)

___

Expand All @@ -188,7 +188,7 @@ true

#### Defined in

[types.ts:63](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L63)
[types.ts:63](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L63)

___

Expand All @@ -204,4 +204,4 @@ The version of the Telegram widget to deal with browser caching.

#### Defined in

[types.ts:68](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L68)
[types.ts:68](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L68)
22 changes: 11 additions & 11 deletions packages/react/docs/interfaces/LoginButtonProps.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The username of the bot that will be used to authenticate the user.

#### Defined in

[types.ts:25](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L25)
[types.ts:25](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L25)

___

Expand All @@ -44,7 +44,7 @@ The URL where the auth data from Telegram will be sent.

#### Defined in

[types.ts:20](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L20)
[types.ts:20](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L20)

___

Expand All @@ -62,7 +62,7 @@ The size of the button.

#### Defined in

[types.ts:32](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L32)
[types.ts:32](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L32)

___

Expand All @@ -74,7 +74,7 @@ The radius of the button corners.

#### Defined in

[types.ts:37](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L37)
[types.ts:37](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L37)

___

Expand All @@ -92,20 +92,20 @@ The language of the button.

#### Defined in

[types.ts:44](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L44)
[types.ts:44](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L44)

___

### onAuthCallback

`Optional` **onAuthCallback**: (`data`: [`TelegramAuthData`](TelegramAuthData.md)) => `void`

The callback function that will be called when the user is authenticated.

#### Type declaration

▸ (`data`): `void`

The callback function that will be called when the user is authenticated.

##### Parameters

| Name | Type |
Expand All @@ -118,7 +118,7 @@ The callback function that will be called when the user is authenticated.

#### Defined in

[types.ts:49](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L49)
[types.ts:49](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L49)

___

Expand All @@ -136,7 +136,7 @@ The access level that the bot will request.

#### Defined in

[types.ts:56](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L56)
[types.ts:56](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L56)

___

Expand All @@ -154,7 +154,7 @@ true

#### Defined in

[types.ts:63](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L63)
[types.ts:63](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L63)

___

Expand All @@ -166,4 +166,4 @@ The version of the Telegram widget to deal with browser caching.

#### Defined in

[types.ts:68](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L68)
[types.ts:68](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L68)
14 changes: 7 additions & 7 deletions packages/react/docs/interfaces/TelegramAuthData.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ https://core.telegram.org/widgets/login#receiving-authorization-data

#### Defined in

[types.ts:7](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L7)
[types.ts:7](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L7)

___

Expand All @@ -38,7 +38,7 @@ ___

#### Defined in

[types.ts:8](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L8)
[types.ts:8](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L8)

___

Expand All @@ -48,7 +48,7 @@ ___

#### Defined in

[types.ts:9](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L9)
[types.ts:9](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L9)

___

Expand All @@ -58,7 +58,7 @@ ___

#### Defined in

[types.ts:10](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L10)
[types.ts:10](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L10)

___

Expand All @@ -68,7 +68,7 @@ ___

#### Defined in

[types.ts:11](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L11)
[types.ts:11](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L11)

___

Expand All @@ -78,7 +78,7 @@ ___

#### Defined in

[types.ts:12](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L12)
[types.ts:12](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L12)

___

Expand All @@ -88,4 +88,4 @@ ___

#### Defined in

[types.ts:13](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L13)
[types.ts:13](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L13)
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@telegram-auth/react",
"version": "1.0.3",
"version": "1.0.4",
"description": "React component to display Telegram Login Widget",
"keywords": [
"telegram",
Expand Down
24 changes: 12 additions & 12 deletions packages/server/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@

### AuthDataMap

Ƭ **AuthDataMap**: [`Map`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map )<`string`, `string` \| `number`\>
Ƭ **AuthDataMap**: [`Map`]( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map )\<`string`, `string` \| `number`\>

Shape of the data to be passed AuthDataValidator.validate().

#### Defined in

[utils/types.ts:4](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/server/src/utils/types.ts#L4)
[utils/types.ts:4](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/server/src/utils/types.ts#L4)

## Functions

### hexStringToArrayBuffer

**hexStringToArrayBuffer**(`hexString`): [`Uint8Array`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array )
**hexStringToArrayBuffer**(`hexString`): [`Uint8Array`]( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array )

It takes a hex string and returns an array buffer

Expand All @@ -52,13 +52,13 @@ It takes a hex string and returns an array buffer

#### Returns

[`Uint8Array`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array )
[`Uint8Array`]( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array )

A Uint8Array of the hexString.

#### Defined in

[utils/hexStringToArrayBuffer.ts:7](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/server/src/utils/hexStringToArrayBuffer.ts#L7)
[utils/hexStringToArrayBuffer.ts:7](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/server/src/utils/hexStringToArrayBuffer.ts#L7)

___

Expand All @@ -73,7 +73,7 @@ It's useful for parsing the URLSearchParams received from Telegram.

| Name | Type | Description |
| :------ | :------ | :------ |
| `searchParams` | [`URLSearchParams`]( https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams ) | URLSearchParams |
| `searchParams` | [`URLSearchParams`]( https://developer.mozilla.org/docs/Web/API/URLSearchParams ) | URLSearchParams |

#### Returns

Expand All @@ -83,7 +83,7 @@ A new Map object with the entries from the searchParams object.

#### Defined in

[utils/searchParamsToAuthDataMap.ts:10](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/server/src/utils/searchParamsToAuthDataMap.ts#L10)
[utils/searchParamsToAuthDataMap.ts:10](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/server/src/utils/searchParamsToAuthDataMap.ts#L10)

___

Expand All @@ -97,7 +97,7 @@ It takes an object and returns auth data Map

| Name | Type | Description |
| :------ | :------ | :------ |
| `data` | [`Record`]( https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type )<`string`, `string` \| `number`\> | The object to convert to a Map |
| `data` | [`Record`]( https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type )\<`string`, `string` \| `number`\> | The object to convert to a Map |

#### Returns

Expand All @@ -107,13 +107,13 @@ A new Map object with the entries of the object passed in.

#### Defined in

[utils/objectToAuthDataMap.ts:9](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/server/src/utils/objectToAuthDataMap.ts#L9)
[utils/objectToAuthDataMap.ts:9](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/server/src/utils/objectToAuthDataMap.ts#L9)

___

### urlStrToAuthDataMap

**urlStrToAuthDataMap**(`urlStr`): [`Map`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map )<`string`, `string`\>
**urlStrToAuthDataMap**(`urlStr`): [`Map`]( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map )\<`string`, `string`\>

It takes a URL string and returns auth data Map from the URL's query parameters.
It's useful for parsing the URL received from Telegram.
Expand All @@ -126,10 +126,10 @@ It's useful for parsing the URL received from Telegram.

#### Returns

[`Map`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map )<`string`, `string`\>
[`Map`]( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map )\<`string`, `string`\>

A Map object with the key/value pairs from the URL's query string.

#### Defined in

[utils/urlStrToAuthDataMap.ts:8](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/server/src/utils/urlStrToAuthDataMap.ts#L8)
[utils/urlStrToAuthDataMap.ts:8](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/server/src/utils/urlStrToAuthDataMap.ts#L8)
Loading

0 comments on commit f3cfc79

Please sign in to comment.