@axium/client 0.28.0 → 0.28.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/dist/cache.js CHANGED
@@ -37,7 +37,7 @@ export class Cache {
37
37
  return this.items.size;
38
38
  }
39
39
  valid(timestamp) {
40
- return !this.options.ttl || !timestamp || timestamp.valueOf() + this.options.ttl < Date.now();
40
+ return !this.options.ttl || !timestamp || timestamp + this.options.ttl > Date.now();
41
41
  }
42
42
  write(key, value) {
43
43
  if (isThenable(value)) {
@@ -11,7 +11,7 @@ export declare class Handle<S extends z.ZodObject> {
11
11
  save(): void;
12
12
  update(): Promise<void>;
13
13
  isValid(): Promise<boolean>;
14
- get data(): z.infer<S>;
14
+ get data(): z.infer<S> | undefined;
15
15
  static [create]<S extends z.ZodObject>(init: Init<S>): Handle<S>;
16
16
  }
17
17
  export interface Init<S extends z.ZodObject> {
package/dist/cli/index.js CHANGED
@@ -52,9 +52,9 @@ program.command('logout').action(async () => {
52
52
  program.command('status').action(() => {
53
53
  if (!config.token)
54
54
  return console.log('Not logged in.');
55
- if (!config.cache)
55
+ const { session } = cache.meta.data || {};
56
+ if (!session)
56
57
  return console.log('No session data available.');
57
- const { session } = cache.meta.data;
58
58
  console.log('Logged in to', new URL(prefix).host);
59
59
  console.log(styleText('whiteBright', 'Session:'), 'valid until', session.expires.toLocaleDateString(), styleText('dim', `(${session.id})`));
60
60
  const { user } = session;
package/lib/Upload.svelte CHANGED
@@ -20,7 +20,7 @@
20
20
  <Icon i={forMime(file.type)} />
21
21
  {#if !progress[i]}
22
22
  <div class="name">
23
- <span>{file.name}</span>
23
+ <span>{file.webkitRelativePath || file.name}</span>
24
24
  </div>
25
25
  <button
26
26
  onclick={e => {
@@ -35,12 +35,12 @@
35
35
  </button>
36
36
  {:else if progress[i][0] == progress[i][1]}
37
37
  <div class="name">
38
- <span>{file.name}</span>
38
+ <span>{file.webkitRelativePath || file.name}</span>
39
39
  </div>
40
40
  <Icon i="cloud-check" />
41
41
  {:else}
42
42
  <div class="name">
43
- <span>{file.name}</span>
43
+ <span>{file.webkitRelativePath || file.name}</span>
44
44
  <progress value={progress[i][0]} max={progress[i][1]}></progress>
45
45
  </div>
46
46
  <Icon i="cloud-arrow-up" />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axium/client",
3
- "version": "0.28.0",
3
+ "version": "0.28.1",
4
4
  "author": "James Prevett <jp@jamespre.dev>",
5
5
  "funding": {
6
6
  "type": "individual",
@@ -54,7 +54,7 @@
54
54
  },
55
55
  "dependencies": {
56
56
  "@simplewebauthn/browser": "^13.1.0",
57
- "commander": "^14.0.0",
57
+ "commander": "^15.0.0",
58
58
  "music-metadata": "^11.12.3"
59
59
  }
60
60
  }