1 |
|
2 | import { ConfigParams } from 'pip-services3-commons-node';
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 | export declare class CredentialParams extends ConfigParams {
|
41 | |
42 |
|
43 |
|
44 |
|
45 |
|
46 | constructor(values?: any);
|
47 | /**
|
48 | * Checks if these credential parameters shall be retrieved from [[CredentialStore]].
|
49 | * The credential parameters are redirected to [[CredentialStore]] when store_key parameter is set.
|
50 | *
|
51 | * @returns true if credentials shall be retrieved from [[CredentialStore]]
|
52 | *
|
53 | * @see [[getStoreKey]]
|
54 | */
|
55 | useCredentialStore(): boolean;
|
56 | /**
|
57 | * Gets the key to retrieve these credentials from [[CredentialStore]].
|
58 | * If this key is null, than all parameters are already present.
|
59 | *
|
60 | * @returns the store key to retrieve credentials.
|
61 | *
|
62 | * @see [[useCredentialStore]]
|
63 | */
|
64 | getStoreKey(): string;
|
65 | /**
|
66 | * Sets the key to retrieve these parameters from [[CredentialStore]].
|
67 | *
|
68 | * @param value a new key to retrieve credentials.
|
69 | */
|
70 | setStoreKey(value: string): void;
|
71 | /**
|
72 | * Gets the user name.
|
73 | * The value can be stored in parameters "username" or "user".
|
74 | *
|
75 | * @returns the user name.
|
76 | */
|
77 | getUsername(): string;
|
78 | /**
|
79 | * Sets the user name.
|
80 | *
|
81 | * @param value a new user name.
|
82 | */
|
83 | setUsername(value: string): void;
|
84 | /**
|
85 | * Get the user password.
|
86 | * The value can be stored in parameters "password" or "pass".
|
87 | *
|
88 | * @returns the user password.
|
89 | */
|
90 | getPassword(): string;
|
91 | /**
|
92 | * Sets the user password.
|
93 | *
|
94 | * @param value a new user password.
|
95 | */
|
96 | setPassword(value: string): void;
|
97 | /**
|
98 | * Gets the application access id.
|
99 | * The value can be stored in parameters "access_id" pr "client_id"
|
100 | *
|
101 | * @returns the application access id.
|
102 | */
|
103 | getAccessId(): string;
|
104 | /**
|
105 | * Sets the application access id.
|
106 | *
|
107 | * @param value a new application access id.
|
108 | */
|
109 | setAccessId(value: string): void;
|
110 | /**
|
111 | * Gets the application secret key.
|
112 | * The value can be stored in parameters "access_key", "client_key" or "secret_key".
|
113 | *
|
114 | * @returns the application secret key.
|
115 | */
|
116 | getAccessKey(): string;
|
117 | /**
|
118 | * Sets the application secret key.
|
119 | *
|
120 | * @param value a new application secret key.
|
121 | */
|
122 | setAccessKey(value: string): void;
|
123 | /**
|
124 | * Creates a new CredentialParams object filled with key-value pairs serialized as a string.
|
125 | *
|
126 | * @param line a string with serialized key-value pairs as "key1=value1;key2=value2;..."
|
127 | * Example: "Key1=123;Key2=ABC;Key3=2016-09-16T00:00:00.00Z"
|
128 | * @returns a new CredentialParams object.
|
129 | */
|
130 | static fromString(line: string): CredentialParams;
|
131 | /**
|
132 | * Creates a new CredentialParams object filled with provided key-value pairs called tuples.
|
133 | * Tuples parameters contain a sequence of key1, value1, key2, value2, ... pairs.
|
134 | *
|
135 | * @param tuples the tuples to fill a new CredentialParams object.
|
136 | * @returns a new CredentialParams object.
|
137 | */
|
138 | static fromTuples(...tuples: any[]): CredentialParams;
|
139 | /**
|
140 | * Retrieves all CredentialParams from configuration parameters
|
141 | * from "credentials" section. If "credential" section is present instead,
|
142 | * than it returns a list with only one CredentialParams.
|
143 | *
|
144 | * @param config a configuration parameters to retrieve credentials
|
145 | * @returns a list of retrieved CredentialParams
|
146 | */
|
147 | static manyFromConfig(config: ConfigParams): CredentialParams[];
|
148 | /**
|
149 | * Retrieves a single CredentialParams from configuration parameters
|
150 | * from "credential" section. If "credentials" section is present instead,
|
151 | * then is returns only the first credential element.
|
152 | *
|
153 | * @param config ConfigParams, containing a section named "credential(s)".
|
154 | * @returns the generated CredentialParams object.
|
155 | *
|
156 | * @see [[manyFromConfig]]
|
157 | */
|
158 | static fromConfig(config: ConfigParams): CredentialParams;
|
159 | }
|