Skip to content

Commit 3ff8a71

Browse files
Add extra return types to fetchOrg (#39)
* Add extra return types to fetchOrg * Fix import
1 parent ab99958 commit 3ff8a71

File tree

5 files changed

+20
-5
lines changed

5 files changed

+20
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"type": "git",
55
"url": "https://github.com/PropelAuth/node"
66
},
7-
"version": "2.1.12",
7+
"version": "2.1.13",
88
"license": "MIT",
99
"keywords": [
1010
"auth",

src/api/org.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import {
66
UpdateOrgException,
77
} from "../exceptions"
88
import { httpRequest } from "../http"
9-
import { CreatedOrg, Org } from "../user"
9+
import { CreatedOrg, Org, Organization } from "../user"
1010
import { isValidId, parseSnakeCaseToCamelCase } from "../utils"
1111

1212
const ENDPOINT_PATH = "/api/backend/v1/org"
1313

1414
// GET
15-
export function fetchOrg(authUrl: URL, integrationApiKey: string, orgId: string): Promise<Org | null> {
15+
export function fetchOrg(authUrl: URL, integrationApiKey: string, orgId: string): Promise<Organization | null> {
1616
if (!isValidId(orgId)) {
1717
return Promise.resolve(null)
1818
}

src/auth.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ import {
7777
CreatedOrg,
7878
CreatedUser,
7979
InternalUser,
80-
Org,
80+
Organization,
8181
OrgApiKeyValidation,
8282
OrgIdToOrgMemberInfo,
8383
OrgMemberInfo,
@@ -204,7 +204,7 @@ export function initBaseAuth(opts: BaseAuthOptions) {
204204
)
205205
}
206206

207-
function fetchOrgWrapper(orgId: string): Promise<Org | null> {
207+
function fetchOrgWrapper(orgId: string): Promise<Organization | null> {
208208
return fetchOrg(authUrl, integrationApiKey, orgId)
209209
}
210210

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export {
4747
InternalOrgMemberInfo,
4848
InternalUser,
4949
Org,
50+
Organization,
5051
OrgIdToOrgMemberInfo,
5152
OrgMemberInfo,
5253
toOrgIdToOrgMemberInfo,

src/user.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,20 @@ export type Org = {
159159
metadata: { [key: string]: any }
160160
}
161161

162+
export type Organization = {
163+
orgId: string
164+
name: string
165+
urlSafeOrgSlug: string
166+
canSetupSaml: boolean
167+
isSamlConfigured: boolean
168+
isSamlInTestMode: boolean
169+
maxUsers?: number
170+
metadata?: { [key: string]: any }
171+
domain?: string
172+
domainAutojoin: boolean
173+
domainRestrict: boolean
174+
}
175+
162176
export type CreatedOrg = {
163177
orgId: string
164178
name: string

0 commit comments

Comments
 (0)