@contentstack/cli-utilities 1.4.0 → 1.4.1
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/lib/auth-handler.js +1 -1
- package/package.json +1 -1
- package/types/auth-handler.d.ts +36 -37
- package/types/helpers.d.ts +1 -1
- package/types/index.d.ts +2 -65
package/lib/auth-handler.js
CHANGED
|
@@ -338,7 +338,7 @@ class AuthHandler {
|
|
|
338
338
|
}
|
|
339
339
|
});
|
|
340
340
|
}
|
|
341
|
-
|
|
341
|
+
isAuthenticated() {
|
|
342
342
|
const authorizationType = config_handler_1.default.get(this.authorisationTypeKeyName);
|
|
343
343
|
return (authorizationType === this.authorisationTypeOAUTHValue || authorizationType === this.authorisationTypeAUTHValue);
|
|
344
344
|
}
|
package/package.json
CHANGED
package/types/auth-handler.d.ts
CHANGED
|
@@ -3,43 +3,42 @@
|
|
|
3
3
|
* Auth handler
|
|
4
4
|
*/
|
|
5
5
|
declare class AuthHandler {
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
isAuthorisationTypeOAuth(): Promise<boolean>;
|
|
6
|
+
private _host;
|
|
7
|
+
private codeVerifier;
|
|
8
|
+
private OAuthBaseURL;
|
|
9
|
+
private OAuthAppId;
|
|
10
|
+
private OAuthClientId;
|
|
11
|
+
private OAuthRedirectURL;
|
|
12
|
+
private OAuthScope;
|
|
13
|
+
private OAuthResponseType;
|
|
14
|
+
private authTokenKeyName;
|
|
15
|
+
private authEmailKeyName;
|
|
16
|
+
private oauthAccessTokenKeyName;
|
|
17
|
+
private oauthDateTimeKeyName;
|
|
18
|
+
private oauthUserUidKeyName;
|
|
19
|
+
private oauthOrgUidKeyName;
|
|
20
|
+
private oauthRefreshTokenKeyName;
|
|
21
|
+
private authorisationTypeKeyName;
|
|
22
|
+
private authorisationTypeOAUTHValue;
|
|
23
|
+
private authorisationTypeAUTHValue;
|
|
24
|
+
private allAuthConfigItems;
|
|
25
|
+
set host(contentStackHost: any);
|
|
26
|
+
constructor();
|
|
27
|
+
setOAuthBaseURL(): Promise<void>;
|
|
28
|
+
oauth(): Promise<object>;
|
|
29
|
+
createHTTPServer(): Promise<object>;
|
|
30
|
+
openOAuthURL(): Promise<object>;
|
|
31
|
+
getAccessToken(code: string): Promise<object>;
|
|
32
|
+
setConfigData(type: string, userData?: any): Promise<object>;
|
|
33
|
+
unsetConfigData(type?: string): Promise<void>;
|
|
34
|
+
refreshToken(): Promise<object>;
|
|
35
|
+
getUserDetails(data: any): Promise<object>;
|
|
36
|
+
isAuthenticated(): boolean;
|
|
37
|
+
getAuthorisationType(): Promise<any>;
|
|
38
|
+
isAuthorisationTypeBasic(): Promise<boolean>;
|
|
39
|
+
isAuthorisationTypeOAuth(): Promise<boolean>;
|
|
40
|
+
checkExpiryAndRefresh: (force?: boolean) => Promise<void | object>;
|
|
41
|
+
compareOAuthExpiry(force?: boolean): Promise<void | object>;
|
|
43
42
|
}
|
|
44
43
|
declare const _default: AuthHandler;
|
|
45
44
|
export default _default;
|
package/types/helpers.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const isAuthenticated: () =>
|
|
1
|
+
export declare const isAuthenticated: () => boolean;
|
package/types/index.d.ts
CHANGED
|
@@ -4,74 +4,11 @@ export { default as CLIError } from './cli-error';
|
|
|
4
4
|
export { default as messageHandler } from './message-handler';
|
|
5
5
|
export { default as authHandler } from './auth-handler';
|
|
6
6
|
export { default as configHandler } from './config-handler';
|
|
7
|
-
export {
|
|
8
|
-
default as managementSDKClient,
|
|
9
|
-
managementSDKInitiator,
|
|
10
|
-
ContentstackClient,
|
|
11
|
-
ContentstackConfig,
|
|
12
|
-
} from './contentstack-management-sdk';
|
|
7
|
+
export { default as managementSDKClient, managementSDKInitiator, ContentstackClient, ContentstackConfig, } from './contentstack-management-sdk';
|
|
13
8
|
export { default as printFlagDeprecation } from './flag-deprecation-check';
|
|
14
9
|
export * from './http-client';
|
|
15
10
|
export { default as NodeCrypto } from './encrypter';
|
|
16
11
|
export { Args as args, Flags as flags, Command } from './cli-ux';
|
|
17
|
-
export {
|
|
18
|
-
Args,
|
|
19
|
-
CommandHelp,
|
|
20
|
-
Config,
|
|
21
|
-
Errors,
|
|
22
|
-
Flags,
|
|
23
|
-
loadHelpClass,
|
|
24
|
-
Help,
|
|
25
|
-
HelpBase,
|
|
26
|
-
HelpSection,
|
|
27
|
-
HelpSectionRenderer,
|
|
28
|
-
HelpSectionKeyValueTable,
|
|
29
|
-
Hook,
|
|
30
|
-
Interfaces,
|
|
31
|
-
Parser,
|
|
32
|
-
Plugin,
|
|
33
|
-
run,
|
|
34
|
-
toCached,
|
|
35
|
-
tsPath,
|
|
36
|
-
toStandardizedId,
|
|
37
|
-
toConfiguredId,
|
|
38
|
-
settings,
|
|
39
|
-
Settings,
|
|
40
|
-
flush,
|
|
41
|
-
ux,
|
|
42
|
-
execute,
|
|
43
|
-
stderr,
|
|
44
|
-
stdout,
|
|
45
|
-
} from '@oclif/core';
|
|
46
|
-
export { FlagInput } from '@oclif/core/lib/interfaces/parser';
|
|
47
12
|
export * from './helpers';
|
|
48
|
-
export {
|
|
49
|
-
Args,
|
|
50
|
-
CommandHelp,
|
|
51
|
-
Config,
|
|
52
|
-
Errors,
|
|
53
|
-
Flags,
|
|
54
|
-
loadHelpClass,
|
|
55
|
-
Help,
|
|
56
|
-
HelpBase,
|
|
57
|
-
HelpSection,
|
|
58
|
-
HelpSectionRenderer,
|
|
59
|
-
HelpSectionKeyValueTable,
|
|
60
|
-
Hook,
|
|
61
|
-
Interfaces,
|
|
62
|
-
Parser,
|
|
63
|
-
Plugin,
|
|
64
|
-
run,
|
|
65
|
-
toCached,
|
|
66
|
-
tsPath,
|
|
67
|
-
toStandardizedId,
|
|
68
|
-
toConfiguredId,
|
|
69
|
-
settings,
|
|
70
|
-
Settings,
|
|
71
|
-
flush,
|
|
72
|
-
ux,
|
|
73
|
-
execute,
|
|
74
|
-
stderr,
|
|
75
|
-
stdout,
|
|
76
|
-
} from '@oclif/core';
|
|
13
|
+
export { Args, CommandHelp, Config, Errors, Flags, loadHelpClass, Help, HelpBase, HelpSection, HelpSectionRenderer, HelpSectionKeyValueTable, Hook, Interfaces, Parser, Plugin, run, toCached, tsPath, toStandardizedId, toConfiguredId, settings, Settings, flush, ux, execute, stderr, stdout, } from '@oclif/core';
|
|
77
14
|
export { FlagInput } from '@oclif/core/lib/interfaces/parser';
|