@monimesl/dot-cli 0.1.0-alpha.24 → 0.1.0-alpha.26

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.
@@ -9,12 +9,13 @@ export default definePage({
9
9
  setNonce: (_state, event: ValueEvent) => ({ nonce: event.detail.value }),
10
10
  },
11
11
  actions: {
12
- async read(state) {
12
+ async signIn(state) {
13
13
  try {
14
- const { fullName, accountIdToken } = await this.dash.account.readProfile({
14
+ const { fullName, alias, accountIdToken } = await this.dash.account.signIn({
15
+ mode: 'simple',
15
16
  nonce: state.nonce,
16
17
  });
17
- this.setState({ fullName, accountIdToken, note: '' });
18
+ this.setState({ fullName, alias, accountIdToken, note: '' });
18
19
  } catch (error) {
19
20
  this.setState({ note: errorMessage(error) });
20
21
  }
@@ -2,6 +2,7 @@ export default {
2
2
  // A fixed nonce, so the token names the person the same way each time in this dot.
3
3
  nonce: 'salone-sounds',
4
4
  fullName: '',
5
+ alias: '',
5
6
  accountIdToken: '',
6
7
  note: '',
7
8
  };
@@ -3,14 +3,15 @@
3
3
  <Text>Who is signed in to Dash. It needs the account permission in dot.json.</Text>
4
4
 
5
5
  <View gap="small">
6
- <Text variant="subtitle">readProfile</Text>
7
- <Text variant="caption" tone="muted">Gives the person's full name, and a token: a hash of their Monimeer id, this dot's id and the nonce. The same nonce gives the same token. Dash makes it on the phone, so it names the person, but proves nothing to the dot's server.</Text>
6
+ <Text variant="subtitle">signIn</Text>
7
+ <Text variant="caption" tone="muted">With mode "simple", Dash says who the person is: their full name, the phone number or email address they use Dash with, and a token: a SHA-512 hash of this dot's id, their Monimeer id and the nonce. The same nonce gives the same token. Dash makes it on the phone, so it names the person, but proves nothing to the dot's server.</Text>
8
8
  <View variant="card" gap="medium">
9
9
  <Input label="Nonce" value="{{ nonce }}" onChange="setNonce" />
10
- <Button onClick="read">Read the profile</Button>
10
+ <Button onClick="signIn">Sign in with Dash</Button>
11
11
  <If condition="{{ fullName }}">
12
12
  <View gap="none">
13
13
  <DetailRow label="fullName" value="{{ fullName }}" />
14
+ <DetailRow label="alias" value="{{ alias }}" />
14
15
  <DetailRow label="accountIdToken" value="{{ accountIdToken }}" />
15
16
  </View>
16
17
  </If>
@@ -41,6 +41,9 @@ export default definePage({
41
41
  case 'denied':
42
42
  await this.dash.network.http.request({ url: 'https://example.com' });
43
43
  break;
44
+ case 'missing':
45
+ await this.dash.storage.file.read('never-saved.txt');
46
+ break;
44
47
  }
45
48
  this.setState({ code: 'none', message: 'It worked' });
46
49
  } catch (error) {
@@ -32,6 +32,7 @@
32
32
  <View direction="row" wrap gap="small">
33
33
  <Button variant="secondary" data-call="invalid" onClick="show">Pick a date between bad limits</Button>
34
34
  <Button variant="secondary" data-call="denied" onClick="show">Reach an unlisted host</Button>
35
+ <Button variant="secondary" data-call="missing" onClick="show">Read a file never saved</Button>
35
36
  </View>
36
37
  </View>
37
38
 
@@ -191,7 +191,7 @@ export default {
191
191
  {
192
192
  page: 'dash/account',
193
193
  title: 'dash.account',
194
- covers: 'readProfile',
194
+ covers: 'signIn',
195
195
  icon: 'user',
196
196
  },
197
197
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monimesl/dot-cli",
3
- "version": "0.1.0-alpha.24",
3
+ "version": "0.1.0-alpha.26",
4
4
  "description": "The dotctl command: build mini apps and run them in the simulator",
5
5
  "type": "module",
6
6
  "repository": {
@@ -24,11 +24,11 @@
24
24
  "dependencies": {
25
25
  "typescript": "^5.9.3",
26
26
  "uqr": "^0.1.3",
27
- "@monimesl/dot-compiler": "0.1.0-alpha.24",
28
- "@monimesl/dot-core": "0.1.0-alpha.24",
29
- "@monimesl/dot-dml-parser": "0.1.0-alpha.24",
30
- "@monimesl/dot-script-parser": "0.1.0-alpha.24",
31
- "@monimesl/dot-simulator": "0.1.0-alpha.24"
27
+ "@monimesl/dot-compiler": "0.1.0-alpha.26",
28
+ "@monimesl/dot-dml-parser": "0.1.0-alpha.26",
29
+ "@monimesl/dot-script-parser": "0.1.0-alpha.26",
30
+ "@monimesl/dot-simulator": "0.1.0-alpha.26",
31
+ "@monimesl/dot-core": "0.1.0-alpha.26"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/node": "^22.20.4",