@cinerino/sdk 16.1.0 → 16.2.0-alpha.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.
|
@@ -1,20 +1,48 @@
|
|
|
1
1
|
import { factory } from '../factory';
|
|
2
2
|
import { Service } from '../service';
|
|
3
|
-
type
|
|
3
|
+
type IIdentityAsFindResult = Pick<factory.creativeWork.certification.softwareApplication.ICertification, 'about' | 'dateCreated' | 'dateModified' | 'issuedBy' | 'typeOf'> & {
|
|
4
|
+
/**
|
|
5
|
+
* DB側のアイデンティティID
|
|
6
|
+
*/
|
|
7
|
+
id: string;
|
|
8
|
+
} | Pick<factory.creativeWork.certification.webApplication.ICertification, 'about' | 'dateCreated' | 'dateModified' | 'issuedBy' | 'typeOf'> & {
|
|
9
|
+
/**
|
|
10
|
+
* DB側のアイデンティティID
|
|
11
|
+
*/
|
|
12
|
+
id: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* ひとまずクライアント認証アイデンティティのみ想定
|
|
16
|
+
*/
|
|
4
17
|
interface ISavingIdentity {
|
|
5
18
|
clientId: string;
|
|
6
19
|
clientSecret: string;
|
|
7
20
|
iss: string[];
|
|
8
21
|
}
|
|
22
|
+
type IFindParams = Pick<factory.creativeWork.certification.webApplication.ISearchConditions, 'about' | 'issuedBy' | 'sort'> & {
|
|
23
|
+
limit: number;
|
|
24
|
+
page: number;
|
|
25
|
+
id?: {
|
|
26
|
+
$eq?: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
9
29
|
/**
|
|
10
30
|
* アイデンティティサービス
|
|
11
31
|
*/
|
|
12
32
|
export declare class IdentityService extends Service {
|
|
13
|
-
|
|
33
|
+
addIdentity(params: ISavingIdentity, options: {
|
|
34
|
+
/**
|
|
35
|
+
* アプリケーションタイプに対応
|
|
36
|
+
*/
|
|
37
|
+
aboutTypeOf: factory.creativeWorkType.SoftwareApplication | factory.creativeWorkType.WebApplication;
|
|
38
|
+
}): Promise<{
|
|
14
39
|
id: string;
|
|
15
40
|
}>;
|
|
16
|
-
|
|
41
|
+
findIdentities(params: IFindParams): Promise<IIdentityAsFindResult[]>;
|
|
17
42
|
updateIdentityById(params: ISavingIdentity & {
|
|
43
|
+
/**
|
|
44
|
+
* DB側のアイデンティティID
|
|
45
|
+
*/
|
|
18
46
|
id: string;
|
|
19
47
|
}): Promise<void>;
|
|
20
48
|
deleteIdentityById(params: {
|
|
@@ -7,21 +7,23 @@ const service_1 = require("../service");
|
|
|
7
7
|
* アイデンティティサービス
|
|
8
8
|
*/
|
|
9
9
|
class IdentityService extends service_1.Service {
|
|
10
|
-
async
|
|
10
|
+
async addIdentity(params, options) {
|
|
11
11
|
return this.fetch({
|
|
12
12
|
uri: '/identities',
|
|
13
13
|
method: 'POST',
|
|
14
14
|
body: params,
|
|
15
|
+
qs: options,
|
|
15
16
|
expectedStatusCodes: [http_status_1.status.CREATED]
|
|
16
17
|
})
|
|
17
18
|
.then(async (response) => response.json());
|
|
18
19
|
}
|
|
19
|
-
async
|
|
20
|
+
async findIdentities(params) {
|
|
20
21
|
return this.fetch({
|
|
21
22
|
uri: '/identities',
|
|
22
23
|
method: 'GET',
|
|
23
24
|
qs: params,
|
|
24
|
-
expectedStatusCodes: [http_status_1.status.OK]
|
|
25
|
+
expectedStatusCodes: [http_status_1.status.OK],
|
|
26
|
+
stringifyOptions: { arrayFormat: 'repeat' }
|
|
25
27
|
})
|
|
26
28
|
.then(async (response) => response.json());
|
|
27
29
|
}
|