adapty 0.9.0 → 0.9.2
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/dist/cli/commands/auth/login.js +2 -2
- package/dist/cli/commands/auth/status/command.js +1 -0
- package/dist/cli/commands/auth/status/lib/render.js +3 -0
- package/dist/cli/commands/auth/status/lib/result.d.ts +1 -0
- package/dist/lib/asa-schemas.d.ts +6 -1
- package/dist/lib/config.d.ts +1 -1
- package/dist/sdk/adapty/auth/model.d.ts +0 -1
- package/dist/sdk/core/session.d.ts +1 -1
- package/dist/sdk/core/session.js +4 -3
- package/oclif.manifest.json +1800 -1800
- package/package.json +1 -1
|
@@ -14,7 +14,7 @@ export default class AuthLogin extends BaseCommand {
|
|
|
14
14
|
await this.parse(AuthLogin);
|
|
15
15
|
const session = await openSession(this.config);
|
|
16
16
|
if (session.user !== undefined) {
|
|
17
|
-
this.log(`Already authenticated as ${session.user.
|
|
17
|
+
this.log(`Already authenticated as ${session.user.name}. Re-authenticating...`);
|
|
18
18
|
}
|
|
19
19
|
// No token yet: the same factory without one, which leaves only auth reachable
|
|
20
20
|
const adapty = build({ ...session, token: undefined }, {
|
|
@@ -45,7 +45,7 @@ export default class AuthLogin extends BaseCommand {
|
|
|
45
45
|
signal: this.signal,
|
|
46
46
|
});
|
|
47
47
|
await session.store.save({ token: issued.accessToken, user: issued.user });
|
|
48
|
-
this.log(`\nAuthenticated as ${issued.user.
|
|
48
|
+
this.log(`\nAuthenticated as ${issued.user.name}`);
|
|
49
49
|
this.log(`Session saved to ${session.store.path}`);
|
|
50
50
|
}
|
|
51
51
|
/** ADAPTY_APP_URL is the CLI's business: the sdk knows nothing about browsers or dashboards. */
|
|
@@ -13,6 +13,7 @@ export default class AuthStatus extends BaseCommand {
|
|
|
13
13
|
authenticated: true,
|
|
14
14
|
config_path: session.store.path,
|
|
15
15
|
email: session.user?.email,
|
|
16
|
+
name: session.user?.name,
|
|
16
17
|
source: session.source === 'env' ? 'env' : 'file',
|
|
17
18
|
token_prefix: session.token.slice(0, 8),
|
|
18
19
|
};
|
|
@@ -4,6 +4,9 @@ export const renderStatus = (status) => {
|
|
|
4
4
|
return 'Not authenticated. Run `adapty auth login`.';
|
|
5
5
|
}
|
|
6
6
|
const lines = [];
|
|
7
|
+
if (status.name !== undefined) {
|
|
8
|
+
lines.push(`User: ${status.name}`);
|
|
9
|
+
}
|
|
7
10
|
if (status.email !== undefined) {
|
|
8
11
|
lines.push(`Email: ${status.email}`);
|
|
9
12
|
}
|
|
@@ -149,10 +149,15 @@ export type AsaSearchTermDTO = {
|
|
|
149
149
|
campaign_group_id: string;
|
|
150
150
|
campaign_id: string;
|
|
151
151
|
country_or_region: string;
|
|
152
|
+
impression_midpoint_all: null | string;
|
|
153
|
+
impression_midpoint_first: null | string;
|
|
154
|
+
impression_share_all: null | string;
|
|
155
|
+
impression_share_first: null | string;
|
|
152
156
|
keyword_id: null | string;
|
|
153
157
|
match_type: AsaKeywordMatchType | null;
|
|
154
158
|
metrics: AsaMetricsDTO;
|
|
155
|
-
|
|
159
|
+
rank_all: null | number;
|
|
160
|
+
rank_first: null | number;
|
|
156
161
|
search_popularity: null | number;
|
|
157
162
|
source: null | string;
|
|
158
163
|
text: null | string;
|
package/dist/lib/config.d.ts
CHANGED
package/dist/sdk/core/session.js
CHANGED
|
@@ -3,7 +3,8 @@ import { join } from 'node:path';
|
|
|
3
3
|
import { StorageError } from './errors.js';
|
|
4
4
|
/**
|
|
5
5
|
* The file and field names the published CLI already writes. A rename would log every existing
|
|
6
|
-
* user out, so the on-disk contract stays `{ "access_token", "user": { "email", "name" } }
|
|
6
|
+
* user out, so the on-disk contract stays `{ "access_token", "user": { "email", "name" } }`, where
|
|
7
|
+
* only a file written before the server stopped sending the email still has one.
|
|
7
8
|
*/
|
|
8
9
|
const FILE_NAME = 'config.json';
|
|
9
10
|
/** A file under a directory the adapter picks: the sdk touches neither HOME nor process.env. */
|
|
@@ -60,10 +61,10 @@ const toSession = (parsed) => {
|
|
|
60
61
|
};
|
|
61
62
|
const toUser = (value) => {
|
|
62
63
|
const record = asRecord(value);
|
|
63
|
-
if (record === undefined || typeof record.
|
|
64
|
+
if (record === undefined || typeof record.name !== 'string') {
|
|
64
65
|
return undefined;
|
|
65
66
|
}
|
|
66
|
-
return { email: record.email, name: record.name };
|
|
67
|
+
return typeof record.email === 'string' ? { email: record.email, name: record.name } : { name: record.name };
|
|
67
68
|
};
|
|
68
69
|
const asRecord = (value) => (typeof value === 'object' && value !== null ? value : undefined);
|
|
69
70
|
const isErrno = (error, code) => error instanceof Error && 'code' in error && error.code === code;
|