Skip to content

Commit

Permalink
fix!: move useSession hook to /client entry point (#255)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-jonas authored Oct 30, 2024
1 parent d95a4ed commit b1ddb3f
Show file tree
Hide file tree
Showing 14 changed files with 779 additions and 78 deletions.
228 changes: 228 additions & 0 deletions packages/elements-react/api-report/elements-react-client.api.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
{
"metadata": {
"toolPackage": "@microsoft/api-extractor",
"toolVersion": "7.47.9",
"schemaVersion": 1011,
"oldestForwardsCompatibleVersion": 1001,
"tsdocConfig": {
"$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json",
"noStandardTags": true,
"tagDefinitions": [
{
"tagName": "@alpha",
"syntaxKind": "modifier"
},
{
"tagName": "@beta",
"syntaxKind": "modifier"
},
{
"tagName": "@defaultValue",
"syntaxKind": "block"
},
{
"tagName": "@decorator",
"syntaxKind": "block",
"allowMultiple": true
},
{
"tagName": "@deprecated",
"syntaxKind": "block"
},
{
"tagName": "@eventProperty",
"syntaxKind": "modifier"
},
{
"tagName": "@example",
"syntaxKind": "block",
"allowMultiple": true
},
{
"tagName": "@experimental",
"syntaxKind": "modifier"
},
{
"tagName": "@inheritDoc",
"syntaxKind": "inline"
},
{
"tagName": "@internal",
"syntaxKind": "modifier"
},
{
"tagName": "@label",
"syntaxKind": "inline"
},
{
"tagName": "@link",
"syntaxKind": "inline",
"allowMultiple": true
},
{
"tagName": "@override",
"syntaxKind": "modifier"
},
{
"tagName": "@packageDocumentation",
"syntaxKind": "modifier"
},
{
"tagName": "@param",
"syntaxKind": "block",
"allowMultiple": true
},
{
"tagName": "@privateRemarks",
"syntaxKind": "block"
},
{
"tagName": "@public",
"syntaxKind": "modifier"
},
{
"tagName": "@readonly",
"syntaxKind": "modifier"
},
{
"tagName": "@remarks",
"syntaxKind": "block"
},
{
"tagName": "@returns",
"syntaxKind": "block"
},
{
"tagName": "@sealed",
"syntaxKind": "modifier"
},
{
"tagName": "@see",
"syntaxKind": "block"
},
{
"tagName": "@throws",
"syntaxKind": "block",
"allowMultiple": true
},
{
"tagName": "@typeParam",
"syntaxKind": "block",
"allowMultiple": true
},
{
"tagName": "@virtual",
"syntaxKind": "modifier"
},
{
"tagName": "@betaDocumentation",
"syntaxKind": "modifier"
},
{
"tagName": "@internalRemarks",
"syntaxKind": "block"
},
{
"tagName": "@preapproved",
"syntaxKind": "modifier"
}
],
"supportForTags": {
"@alpha": true,
"@beta": true,
"@defaultValue": true,
"@decorator": true,
"@deprecated": true,
"@eventProperty": true,
"@example": true,
"@experimental": true,
"@inheritDoc": true,
"@internal": true,
"@label": true,
"@link": true,
"@override": true,
"@packageDocumentation": true,
"@param": true,
"@privateRemarks": true,
"@public": true,
"@readonly": true,
"@remarks": true,
"@returns": true,
"@sealed": true,
"@see": true,
"@throws": true,
"@typeParam": true,
"@virtual": true,
"@betaDocumentation": true,
"@internalRemarks": true,
"@preapproved": true
},
"reportUnsupportedHtmlElements": false
}
},
"kind": "Package",
"canonicalReference": "@ory/elements-react!",
"docComment": "",
"name": "@ory/elements-react",
"preserveMemberOrder": false,
"members": [
{
"kind": "EntryPoint",
"canonicalReference": "@ory/elements-react!",
"name": "",
"preserveMemberOrder": false,
"members": [
{
"kind": "Function",
"canonicalReference": "@ory/elements-react!useSession:function(1)",
"docComment": "/**\n * A hook to get the current session from the Ory Network.\n *\n * Usage:\n * ```ts\n * const { session, error, isLoading } = useSession()\n * ```\n *\n * @returns The current session, error and loading state.\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "useSession: (config?: "
},
{
"kind": "Content",
"text": "{\n sdk: {\n url: string;\n };\n}"
},
{
"kind": "Content",
"text": ") => "
},
{
"kind": "Content",
"text": "{\n session: "
},
{
"kind": "Reference",
"text": "Session",
"canonicalReference": "@ory/client-fetch!Session:interface"
},
{
"kind": "Content",
"text": " | undefined;\n error: string | undefined;\n isLoading: boolean;\n}"
}
],
"fileUrlPath": "dist/client/useSession.d.ts",
"returnTypeTokenRange": {
"startIndex": 3,
"endIndex": 6
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "config",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
},
"isOptional": true
}
],
"name": "useSession"
}
]
}
]
}
22 changes: 22 additions & 0 deletions packages/elements-react/api-report/elements-react-client.api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## API Report File for "@ory/elements-react"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts

import { Session } from '@ory/client-fetch';

// @public
export const useSession: (config?: {
sdk: {
url: string;
};
}) => {
session: Session | undefined;
error: string | undefined;
isLoading: boolean;
};

// (No @packageDocumentation comment for this package)

```
33 changes: 0 additions & 33 deletions packages/elements-react/api-report/elements-react.api.json
Original file line number Diff line number Diff line change
Expand Up @@ -3634,39 +3634,6 @@
"parameters": [],
"name": "useOryFlow"
},
{
"kind": "Function",
"canonicalReference": "@ory/elements-react!useSession:function(1)",
"docComment": "/**\n * A hook to get the current session from the Ory Network.\n *\n * Usage:\n * ```ts\n * const { session, error, isLoading } = useSession()\n * ```\n *\n * @returns The current session, error and loading state.\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "useSession: () => "
},
{
"kind": "Content",
"text": "{\n session: "
},
{
"kind": "Reference",
"text": "Session",
"canonicalReference": "@ory/client-fetch!Session:interface"
},
{
"kind": "Content",
"text": " | undefined;\n error: string | undefined;\n isLoading: boolean;\n}"
}
],
"fileUrlPath": "dist/index.d.ts",
"returnTypeTokenRange": {
"startIndex": 1,
"endIndex": 4
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [],
"name": "useSession"
},
{
"kind": "TypeAlias",
"canonicalReference": "@ory/elements-react!VerificationFlowContainer:type",
Expand Down
8 changes: 0 additions & 8 deletions packages/elements-react/api-report/elements-react.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import { PropsWithChildren } from 'react';
import * as react_jsx_runtime from 'react/jsx-runtime';
import { RecoveryFlow } from '@ory/client-fetch';
import { RegistrationFlow } from '@ory/client-fetch';
import { Session } from '@ory/client-fetch';
import { SettingsFlow } from '@ory/client-fetch';
import { UiNode } from '@ory/client-fetch';
import { UiNodeAnchorAttributes } from '@ory/client-fetch';
Expand Down Expand Up @@ -399,13 +398,6 @@ export function useNodeSorter(): (a: UiNode, b: UiNode, ctx: {
// @public
export function useOryFlow(): FlowContextValue;

// @public
export const useSession: () => {
session: Session | undefined;
error: string | undefined;
isLoading: boolean;
};

// @public
export type VerificationFlowContainer = OryFlow<FlowType.Verification, VerificationFlow>;

Expand Down
Loading

0 comments on commit b1ddb3f

Please sign in to comment.