@spica-devkit/identity 0.9.11 → 0.9.15

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.
@@ -1,8 +1,10 @@
1
- /// <amd-module name="@spica-devkit/identity/src/identity" />
2
- import { Identity, IdentityInitialization, ApikeyInitialization, IndexResult } from "./interface";
1
+ import { Identity, IdentityInitialization, ApikeyInitialization, IndexResult, LoginWithStrategyResponse } from "./interface";
2
+ import { Strategy } from "./interface";
3
3
  export declare function initialize(options: ApikeyInitialization | IdentityInitialization): void;
4
4
  export declare function verifyToken(token: string, baseUrl?: string): Promise<unknown>;
5
5
  export declare function login(identifier: string, password: string, tokenLifeSpan?: number): Promise<string>;
6
+ export declare function loginWithStrategy(id: string): Promise<LoginWithStrategyResponse>;
7
+ export declare function getStrategies(): Promise<Strategy[]>;
6
8
  export declare function get(id: string): Promise<Identity>;
7
9
  export declare function getAll(queryParams?: object): Promise<Identity[] | IndexResult<Identity>>;
8
10
  export declare function insert(identity: Identity): Promise<Identity>;
@@ -1,3 +1,2 @@
1
- /// <amd-module name="@spica-devkit/identity/src/index" />
2
1
  export * from "./identity";
3
2
  export * from "./interface";
@@ -1,4 +1,4 @@
1
- /// <amd-module name="@spica-devkit/identity/src/interface" />
1
+ import { Observable } from "rxjs";
2
2
  export interface Identity {
3
3
  _id?: string;
4
4
  identifier: string;
@@ -6,6 +6,16 @@ export interface Identity {
6
6
  policies?: string[];
7
7
  attributes?: object;
8
8
  }
9
+ export interface Strategy {
10
+ _id: string;
11
+ type: string;
12
+ name: string;
13
+ title: string;
14
+ }
15
+ export interface LoginWithStrategyResponse {
16
+ url: string;
17
+ token: Observable<string>;
18
+ }
9
19
  interface InitializeOptions {
10
20
  publicUrl?: string;
11
21
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@spica-devkit/identity",
3
3
  "license": "AGPLv3",
4
- "version": "0.9.11",
4
+ "version": "0.9.15",
5
5
  "description": "Identity package for Spica.",
6
6
  "author": "spica",
7
7
  "keywords": [
@@ -14,6 +14,7 @@
14
14
  "typings": "dist/index.d.ts",
15
15
  "sideEffects": false,
16
16
  "dependencies": {
17
- "axios": "^0.21.1"
17
+ "axios": "^0.21.1",
18
+ "rxjs": "^6.6.3"
18
19
  }
19
20
  }