1 | import type { CollectionProp, GetAppDefinitionParams, QueryParams } from '../../common-types';
|
2 | import type { AppKeyProps, CreateAppKeyProps } from '../../entities/app-key';
|
3 | import type { OptionalDefaults } from '../wrappers/wrap';
|
4 | export type AppKeyPlainClientAPI = {
|
5 | /**
|
6 | * Creates an App Key
|
7 | * @param params entity IDs to identify the App that the Key belongs to
|
8 | * @param payload options for Key creation, see example for details
|
9 | * @returns the App Key and its metadata
|
10 | * @throws if the request fails, the App or Key is not found, or the payload is malformed
|
11 | * @example
|
12 | * ```javascript
|
13 | * // create an App Key by generating a new private key
|
14 | * const key = await client.appKey.create({
|
15 | * organizationId: '<organization_id>',
|
16 | * appDefinitionId: '<app_definition_id>',
|
17 | * }, {
|
18 | * generate: true
|
19 | * })
|
20 | *
|
21 | * // create an App Key by specifying an existing private key
|
22 | * const keyFromExistingJWK = await client.appKey.create({
|
23 | * organizationId: '<organization_id>',
|
24 | * appDefinitionId: '<app_definition_id>',
|
25 | * }, {
|
26 | * jwk: '<jwk>'
|
27 | * })
|
28 | * ```
|
29 | */
|
30 | create(params: OptionalDefaults<GetAppDefinitionParams>, payload: CreateAppKeyProps): Promise<AppKeyProps>;
|
31 | /**
|
32 | * Fetches the App Key with the given fingerprint
|
33 | * @param params entity IDs to identify the App Key
|
34 | * @returns the App Key
|
35 | * @throws if the request fails, or the App or the Key is not found
|
36 | * @example
|
37 | * ```javascript
|
38 | * const key = await client.appKey.get({
|
39 | * organizationId: '<organization_id>',
|
40 | * appDefinitionId: '<app_definition_id>',
|
41 | * fingerprint: '<fingerprint>',
|
42 | * })
|
43 | * ```
|
44 | */
|
45 | get(params: OptionalDefaults<GetAppDefinitionParams> & {
|
46 | fingerprint: string;
|
47 | }): Promise<AppKeyProps>;
|
48 | /**
|
49 | * Fetches all Keys for the given App
|
50 | * @param params entity IDs to identify the App
|
51 | * @param payload optional pagination query, see example for details
|
52 | * @returns the App Keys
|
53 | * @throws if the request fails, or the App is not found
|
54 | * @example
|
55 | * ```javascript
|
56 | * // with default pagination
|
57 | * const keys = await client.appKey.getMany({
|
58 | * organizationId: '<organization_id>',
|
59 | * appDefinitionId: '<app_definition_id>',
|
60 | * })
|
61 | *
|
62 | * // with explicit pagination
|
63 | * const paginatedKeys = await client.appKey.getMany({
|
64 | * organizationId: '<organization_id>',
|
65 | * appDefinitionId: '<app_definition_id>',
|
66 | * }, {
|
67 | * query: {
|
68 | * skip: '<skip>',
|
69 | * limit: '<limit>',
|
70 | * }
|
71 | * })
|
72 | * ```
|
73 | */
|
74 | getMany(params: OptionalDefaults<GetAppDefinitionParams> & QueryParams): Promise<CollectionProp<AppKeyProps>>;
|
75 | /**
|
76 | * Removes the App Key with the given fingerprint
|
77 | * @param params entity IDs to identify the App Key
|
78 | * @throws if the request fails, or the App or the Key is not found
|
79 | * @example
|
80 | * ```javascript
|
81 | * await client.appKey.delete({
|
82 | * organizationId: '<organization_id>',
|
83 | * appDefinitionId: '<app_definition_id>',
|
84 | * fingerprint: '<fingerprint>',
|
85 | * })
|
86 | * ```
|
87 | */
|
88 | delete(params: OptionalDefaults<GetAppDefinitionParams> & {
|
89 | fingerprint: string;
|
90 | }): Promise<void>;
|
91 | };
|