@vendasta/iam 2.3.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/_generated/host.service.mjs +3 -3
- package/esm2020/lib/_internal/iam.api.service.mjs +3 -3
- package/esm2020/lib/_internal/objects/annotations.mjs +6 -6
- package/esm2020/lib/_internal/objects/api.mjs +360 -360
- package/esm2020/lib/_internal/objects/attributes.mjs +30 -30
- package/esm2020/lib/_internal/objects/field-mask.mjs +6 -6
- package/esm2020/lib/_internal/objects/policies.mjs +46 -46
- package/esm2020/lib/_internal/objects/resources.mjs +35 -35
- package/esm2020/lib/_internal/objects/security-logs.mjs +7 -7
- package/esm2020/lib/_internal/objects/subjects.mjs +62 -62
- package/esm2020/lib/_internal/objects/users.mjs +27 -27
- package/esm2020/lib/_internal/user-iam.api.service.mjs +3 -3
- package/esm2020/lib/http/http.mjs +23 -23
- package/esm2020/lib/http/iam.http.api.service.mjs +3 -3
- package/esm2020/lib/iam.service.mjs +11 -24
- package/fesm2015/vendasta-iam.mjs +973 -985
- package/fesm2015/vendasta-iam.mjs.map +1 -1
- package/fesm2020/vendasta-iam.mjs +2281 -2293
- package/fesm2020/vendasta-iam.mjs.map +1 -1
- package/lib/iam.service.d.ts +4 -8
- package/lib/personas/salesperson.d.ts +1 -1
- package/package.json +5 -7
- package/src/README.md +0 -113
- /package/{vendasta-iam.d.ts → index.d.ts} +0 -0
package/lib/iam.service.d.ts
CHANGED
|
@@ -1,24 +1,20 @@
|
|
|
1
|
-
import { SessionService } from '@vendasta/core';
|
|
2
1
|
import { Observable } from 'rxjs';
|
|
3
|
-
import { ListSecurityLogsResponse, ListUsersResponse } from './_internal/objects/api';
|
|
4
|
-
import { UserIAMApiService } from './_internal/user-iam.api.service';
|
|
5
2
|
import { IamHttpApiService } from './http/iam.http.api.service';
|
|
6
3
|
import { BasePersona } from './personas/base-personas';
|
|
7
4
|
import { PersonaType } from './personas/persona-type.enum';
|
|
8
|
-
import { User } from './_internal/objects/users';
|
|
9
5
|
import { IAMApiService } from './_internal/iam.api.service';
|
|
10
6
|
import { UserIdentifierInterface, UserSortOptionsInterface } from './_internal/interfaces';
|
|
7
|
+
import { ListSecurityLogsResponse, ListUsersResponse } from './_internal/objects/api';
|
|
8
|
+
import { User } from './_internal/objects/users';
|
|
9
|
+
import { UserIAMApiService } from './_internal/user-iam.api.service';
|
|
11
10
|
import * as i0 from "@angular/core";
|
|
12
11
|
export declare class IAMService {
|
|
13
12
|
private api;
|
|
14
13
|
private httpApi;
|
|
15
|
-
private sessionService;
|
|
16
14
|
private iamApi;
|
|
17
|
-
constructor(api: UserIAMApiService, httpApi: IamHttpApiService,
|
|
15
|
+
constructor(api: UserIAMApiService, httpApi: IamHttpApiService, iamApi: IAMApiService);
|
|
18
16
|
getSubjectBySession(sessionId: string, personaType: PersonaType, partnerId?: string): Observable<BasePersona | null>;
|
|
19
|
-
getLoggedInSubject(personaType: PersonaType, partnerId?: string): Observable<BasePersona | null>;
|
|
20
17
|
listPersonas(sessionId: string, personaType?: PersonaType): Observable<BasePersona[]>;
|
|
21
|
-
listLoggedInPersonas(personaType?: PersonaType): Observable<BasePersona[]>;
|
|
22
18
|
getToken(): Observable<string>;
|
|
23
19
|
login(email: string, password: string, personaType?: PersonaType, partnerId?: string): Observable<string>;
|
|
24
20
|
logout(): Observable<boolean>;
|
|
@@ -5,7 +5,7 @@ export declare const TitleChoice: {
|
|
|
5
5
|
REP_MAN_FOR_SMB: string;
|
|
6
6
|
MARKET_FOR_SMB: string;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type TitleChoice = (typeof TitleChoice)[keyof typeof TitleChoice];
|
|
9
9
|
export declare class SalespersonPersona extends NamespacedPersona {
|
|
10
10
|
type: PersonaType;
|
|
11
11
|
emailLower: string;
|
package/package.json
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vendasta/iam",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@angular/common": "^
|
|
6
|
-
"@angular/core": "^
|
|
7
|
-
"@vendasta/core": "^55.0.2",
|
|
8
|
-
"rxjs": "^6.6.6"
|
|
5
|
+
"@angular/common": "^15.1.0",
|
|
6
|
+
"@angular/core": "^15.1.0"
|
|
9
7
|
},
|
|
10
8
|
"author": "Vendasta R&D",
|
|
11
9
|
"description": "SDK to interact with the iam service",
|
|
12
|
-
"typings": "
|
|
10
|
+
"typings": "index.d.ts",
|
|
13
11
|
"license": "ISC",
|
|
14
12
|
"main": "index.js",
|
|
15
13
|
"module": "fesm2015/vendasta-iam.mjs",
|
|
@@ -22,7 +20,7 @@
|
|
|
22
20
|
"default": "./package.json"
|
|
23
21
|
},
|
|
24
22
|
".": {
|
|
25
|
-
"types": "./
|
|
23
|
+
"types": "./index.d.ts",
|
|
26
24
|
"esm2020": "./esm2020/vendasta-iam.mjs",
|
|
27
25
|
"es2020": "./fesm2020/vendasta-iam.mjs",
|
|
28
26
|
"es2015": "./fesm2015/vendasta-iam.mjs",
|
package/src/README.md
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
# IAM SDK
|
|
2
|
-
|
|
3
|
-
## Login
|
|
4
|
-
`login(email: string, password: string, personaType?: PersonaType, partnerId?: string): Observable<string>`
|
|
5
|
-
|
|
6
|
-
Login accepts an email and password to use to attempt to auth a user. If `personaType` isn't specified, IAM will attempt to
|
|
7
|
-
auth the email and password combo against any of the associated personas. If `personaType` and optionally `partnerId` are
|
|
8
|
-
specified, IAM will auth against that persona specifically.
|
|
9
|
-
|
|
10
|
-
## Logout
|
|
11
|
-
`logout(): Observable<boolean>`
|
|
12
|
-
|
|
13
|
-
Logout will clear the user's cookies on IAM's side. Returns true if successful.
|
|
14
|
-
|
|
15
|
-
## SSO Login
|
|
16
|
-
`ssoLogin(nextUrl: string, personaType: PersonaType, partnerId?: string): void`
|
|
17
|
-
|
|
18
|
-
SSOLogin will redirect the user's browser to IAM's SSOLogin page. IAM handles all of the oauth google has in place for
|
|
19
|
-
getting a session using your gmail account (and the whitelabeling of the domain requesting access). Once IAM is done
|
|
20
|
-
handling those requests, IAM will then attempt to find the persona specified in this endpoint (the `personaType` and
|
|
21
|
-
`partnerId` combination). If IAM fails to find a persona, it will redirect to the `nextUrl` with `error` and `status`
|
|
22
|
-
query params indicating why it failed. If IAM is successful in finding the appropriate persona for the request, it
|
|
23
|
-
will redirect to the `nextUrl` with a `session_id` query param. You will then have to take this `session_id` and set up
|
|
24
|
-
the user's session with it, in the same fashion you would have set up the session from the response of the `Login`
|
|
25
|
-
endpoint.
|
|
26
|
-
|
|
27
|
-
## Get Subject By Session
|
|
28
|
-
`getSubjectBySession(sessionId: string, personaType: PersonaType, partnerId?: string): Observable<BasePersona>`
|
|
29
|
-
|
|
30
|
-
Specify the `personaType` and optionally the `partnerId` for the persona you'd like to retrieve using the `sessionId`.
|
|
31
|
-
This endpoint returns a `BasePersona` which is the base class that all Personas inherit. To gain access to the attributes
|
|
32
|
-
of a specific persona, you will need to cast the persona as the requested type.
|
|
33
|
-
|
|
34
|
-
```typescript
|
|
35
|
-
import {BasePersona, PartnerPersona, PersonaType} from '@vendasta/core/iam'
|
|
36
|
-
|
|
37
|
-
this.iamClient.getSubjectBySession('...sessionId...', PersonaType.partner)
|
|
38
|
-
.map((persona: BasePersona) => persona as PartnerPersona)
|
|
39
|
-
.subscribe(...)
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
## Get Logged In Subject
|
|
43
|
-
`getLoggedInSubject(personaType: PersonaType, partnerId?: string): Observable<BasePersona>`
|
|
44
|
-
|
|
45
|
-
Works identically to getSubjectBySession except it grabs the current session being served by the SessionService.
|
|
46
|
-
|
|
47
|
-
## List Personas
|
|
48
|
-
`listPersonas(sessionId: string, personaType?: PersonaType): Observable<BasePersona[]>`
|
|
49
|
-
|
|
50
|
-
Given a `sessionId`, listPersonas will find and return all available personas for the session. Optionally specify a
|
|
51
|
-
`personaType` to filter the results by only that type of persona. List personas will return a list of all the personas
|
|
52
|
-
it found. This endpoint returns `BasePersona` and thus they will need to be casted to their appropriate PersonaTypes to
|
|
53
|
-
gain access to the attributes.
|
|
54
|
-
|
|
55
|
-
```typescript
|
|
56
|
-
import {BasePersona, PartnerPersona, PersonaType, SMBPersona} from '@vendasta/core/iam'
|
|
57
|
-
|
|
58
|
-
this.iamClient.listPersonas('...sessionId...')
|
|
59
|
-
.subscribe((personas: BasePersona[]) => {
|
|
60
|
-
for (const persona of personas) {
|
|
61
|
-
switch(persona.type) {
|
|
62
|
-
case PartnerType.partner:
|
|
63
|
-
const p: PartnerPersona = (persona as PartnerPersona);
|
|
64
|
-
...
|
|
65
|
-
break;
|
|
66
|
-
case PartnerType.smb:
|
|
67
|
-
const p: SMBPersona = (persona as SMBPersona);
|
|
68
|
-
...
|
|
69
|
-
break;
|
|
70
|
-
...
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
## List Logged In Personas
|
|
77
|
-
`listLoggedInPersonas(personaType?: PersonaType): Observable<BasePersona[]>`
|
|
78
|
-
|
|
79
|
-
Works identically to listPersonas except it grabs the current session being served by the SessionService.
|
|
80
|
-
|
|
81
|
-
## Get Token
|
|
82
|
-
`getToken(): Observable<string>`
|
|
83
|
-
|
|
84
|
-
Get token will refresh the 30 minute temporary session a user may have, returning the new `sessionId`.
|
|
85
|
-
|
|
86
|
-
## Get Multi Users
|
|
87
|
-
|
|
88
|
-
`getMultiUsers(userIdentifiers: UserIdentifierInterface[]): Observable<User[]>`
|
|
89
|
-
|
|
90
|
-
This function takes in an array of user identifiers and converts them (via API) into their respective Users that
|
|
91
|
-
are stored in IAM. UserIdentifiers are an object containing one of the following:
|
|
92
|
-
|
|
93
|
-
userId - the user id of a user. This directly identifies the user in our system.
|
|
94
|
-
token - a token for a user signed by the platform. These tokens include: the session token from IAM (i.e. the `session` part of the `namespaced_session` UserIdentifier), as well as access token or identity tokens from SSO.
|
|
95
|
-
|
|
96
|
-
Deprecated identifiers:
|
|
97
|
-
namespacedEmail - an email address scoped to a namespace. A namespace is the id of a partner. Prefer to use user id instead, to avoid handling emails and for a more stable user identifier
|
|
98
|
-
namespacedSession - a session string scoped to a namespace. Use token instead, as sesson is valid token, and namespace is ignored.
|
|
99
|
-
|
|
100
|
-
## List security logs
|
|
101
|
-
|
|
102
|
-
`listSecurityLogs(userId: string, cursor?: string, pageSize?: number, actionId = ''): Observable<ListSecurityLogsResponse>`
|
|
103
|
-
|
|
104
|
-
This function returns security logs for a userId passed in. This is a paged function, but the handling of paged
|
|
105
|
-
information is left to the implementor (for now). Use the cursor to call this function again and retrieve a new
|
|
106
|
-
observable of the response to your call.
|
|
107
|
-
|
|
108
|
-
## List Users
|
|
109
|
-
|
|
110
|
-
`listUsers(namespace: string, email?: string, cursor?: string, pageSize?: number): Observable<ListUsersResponse>`
|
|
111
|
-
|
|
112
|
-
ListUsers returns users for a namespace passed in. This is a paged function, but the handling of paged information
|
|
113
|
-
is left to the implementor (for now). An empty namespace will return users that exist outside of a namespace.
|
|
File without changes
|