@hkdigital/lib-core 0.4.14 → 0.4.15

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.
@@ -36,9 +36,3 @@ export function sign(claims: import("./typedef.js").JwtPayload, secretOrPrivateK
36
36
  * @returns {import('./typedef.js').JwtPayload} claims - The decoded JWT payload
37
37
  */
38
38
  export function verify(token: string, secretOrPrivateKey: import("./typedef.js").Secret, options?: import("./typedef.js").VerifyOptions): import("./typedef.js").JwtPayload;
39
- /**
40
- * Casts jsonwebtoken library errors to internal error types
41
- * @param {Error} error - The original jsonwebtoken error
42
- * @returns {Error} - The corresponding internal error
43
- */
44
- export function castJwtError(error: Error): Error;
@@ -124,12 +124,14 @@ export function verify( token, secretOrPrivateKey, options=VERIFY_OPTIONS )
124
124
  }
125
125
  }
126
126
 
127
+ // Internals
128
+
127
129
  /**
128
130
  * Casts jsonwebtoken library errors to internal error types
129
131
  * @param {Error} error - The original jsonwebtoken error
130
132
  * @returns {Error} - The corresponding internal error
131
133
  */
132
- export function castJwtError(error) {
134
+ function castJwtError(error) {
133
135
  if (error instanceof JwtTokenExpiredError) {
134
136
  return new TokenExpiredError(error.message, error.expiredAt, error);
135
137
  }
@@ -1,3 +1,4 @@
1
+ export * from "./jwt/util.js";
1
2
  export * from "./jwt/generators.js";
2
3
  export * from "./jwt/errors.js";
3
4
  export * from "./jwt/constants.js";
package/dist/auth/jwt.js CHANGED
@@ -6,7 +6,7 @@
6
6
  * verifying tokens, and generating secret keys.
7
7
  */
8
8
 
9
- export * from './jwt/core.js';
9
+ export * from './jwt/util.js';
10
10
  export * from './jwt/generators.js';
11
11
  export * from './jwt/errors.js';
12
12
  export * from './jwt/constants.js';
@@ -0,0 +1 @@
1
+ export * from "./bases/index.js";
@@ -0,0 +1 @@
1
+ export * from './bases/index.js';
@@ -0,0 +1,2 @@
1
+ export * from "./http/headers.js";
2
+ export * from "./http/methods.js";
@@ -0,0 +1,2 @@
1
+ export * from './http/headers.js';
2
+ export * from './http/methods.js';
@@ -0,0 +1,4 @@
1
+ export * from "./mime/application.js";
2
+ export * from "./mime/audio.js";
3
+ export * from "./mime/text.js";
4
+ export * from "./mime/image.js";
@@ -0,0 +1,4 @@
1
+ export * from './mime/application.js';
2
+ export * from './mime/audio.js';
3
+ export * from './mime/text.js';
4
+ export * from './mime/image.js';
@@ -0,0 +1,3 @@
1
+ export * from "./regexp/text.js";
2
+ export * from "./regexp/url.js";
3
+ export * from "./regexp/user.js";
@@ -0,0 +1,3 @@
1
+ export * from './regexp/text.js';
2
+ export * from './regexp/url.js';
3
+ export * from './regexp/user.js';
@@ -1,4 +1,4 @@
1
- export const IDLE: "idle";
1
+ export const DRAG_IDLE: "idle";
2
2
  export const DRAGGING: "dragging";
3
3
  export const DRAG_PREVIEW: "drag-preview";
4
4
  export const DROPPING: "dropping";
@@ -1,5 +1,5 @@
1
1
  // Draggable states
2
- export const IDLE = 'idle'; // Not being dragged
2
+ export const DRAG_IDLE = 'idle'; // Not being dragged
3
3
  export const DRAGGING = 'dragging'; // Currently being dragged
4
4
  export const DRAG_PREVIEW = 'drag-preview'; // Mouse down, before drag
5
5
  export const DROPPING = 'dropping'; // Just dropped, animating
@@ -1,4 +1,4 @@
1
- export const IDLE: "idle";
1
+ export const SUBMIT_IDLE: "idle";
2
2
  export const SUBMITTING: "submitting";
3
3
  export const SUBMIT_OK: "submit-ok";
4
4
  export const SUBMIT_FAILED: "submit-failed";
@@ -1,4 +1,4 @@
1
- export const IDLE = 'idle';
1
+ export const SUBMIT_IDLE = 'idle';
2
2
  export const SUBMITTING = 'submitting';
3
3
  export const SUBMIT_OK = 'submit-ok';
4
4
  export const SUBMIT_FAILED = 'submit-failed';
@@ -0,0 +1,4 @@
1
+ export * from "./states/drag.js";
2
+ export * from "./states/drop.js";
3
+ export * from "./states/input.js";
4
+ export * from "./states/submit.js";
@@ -0,0 +1,4 @@
1
+ export * from './states/drag.js';
2
+ export * from './states/drop.js';
3
+ export * from './states/input.js';
4
+ export * from './states/submit.js';
@@ -0,0 +1 @@
1
+ export * from "./time/index.js";
@@ -0,0 +1 @@
1
+ export * from './time/index.js';
@@ -1,9 +1,9 @@
1
1
  import * as expect from '../../util/expect.js';
2
2
  import { DetailedError } from '../../generic/errors.js';
3
3
 
4
- import { CONTENT_TYPE } from '../../constants/http/index.js';
4
+ import { CONTENT_TYPE } from '../../constants/http.js';
5
5
 
6
- import { APPLICATION_JSON, TEXT_PLAIN } from '../../constants/mime/index.js';
6
+ import { APPLICATION_JSON, TEXT_PLAIN } from '../../constants/mime.js';
7
7
 
8
8
  /**
9
9
  * Try to get error information from the server error response
@@ -17,6 +17,6 @@ export * from './response.js';
17
17
  export * from './http-request.js';
18
18
  export * from './json-request.js';
19
19
 
20
- // import { CONTENT_TYPE, METHOD_GET, METHOD_POST } from '../../constants/http/index.js';
20
+ // import { CONTENT_TYPE, METHOD_GET, METHOD_POST } from '../../constants/http.js';
21
21
 
22
- // import { APPLICATION_JSON } from '../../constants/mime/index.js';
22
+ // import { APPLICATION_JSON } from '../../constants/mime.js';
@@ -1,6 +1,6 @@
1
- import { CONTENT_TYPE, CONTENT_LENGTH } from '../../constants/http/index.js';
1
+ import { CONTENT_TYPE, CONTENT_LENGTH } from '../../constants/http.js';
2
2
 
3
- import { OCTET_STREAM } from '../../constants/mime/index.js';
3
+ import { OCTET_STREAM } from '../../constants/mime.js';
4
4
 
5
5
  /**
6
6
  * Create a response value that can be used by a mocked fetch function
@@ -1,4 +1,4 @@
1
- import { CONTENT_TYPE, CONTENT_LENGTH } from '../../../constants/http/index.js';
1
+ import { CONTENT_TYPE, CONTENT_LENGTH } from '../../../constants/http.js';
2
2
 
3
3
  import { AUDIO_WAV } from '../../../constants/mime/audio.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import { CONTENT_TYPE, CONTENT_LENGTH } from '../../../constants/http/index.js';
1
+ import { CONTENT_TYPE, CONTENT_LENGTH } from '../../../constants/http.js';
2
2
 
3
3
  import { IMAGE_PNG } from '../../../constants/mime/image.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import { CONTENT_TYPE } from '../../constants/http/index.js';
1
+ import { CONTENT_TYPE } from '../../constants/http.js';
2
2
 
3
3
  import { LoadingStateMachine } from '../../state/classes.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import { CONTENT_TYPE, CONTENT_LENGTH } from '../../constants/http/index.js';
1
+ import { CONTENT_TYPE, CONTENT_LENGTH } from '../../constants/http.js';
2
2
 
3
3
  import { OCTET_STREAM } from '../../constants/mime/application.js';
4
4
 
@@ -6,7 +6,7 @@
6
6
  import { DragController } from './DragController.js';
7
7
  import { onDestroy } from 'svelte';
8
8
  import {
9
- IDLE,
9
+ DRAG_IDLE,
10
10
  DRAGGING,
11
11
  DRAG_PREVIEW,
12
12
  DROPPING
@@ -91,7 +91,7 @@
91
91
  let draggableElement;
92
92
 
93
93
  let dragTimeout = null;
94
- let currentState = $state(IDLE);
94
+ let currentState = $state(DRAG_IDLE);
95
95
 
96
96
  // Custom preview follower state
97
97
  let showPreview = $state(false);
@@ -112,7 +112,7 @@
112
112
 
113
113
  // Computed state object for CSS classes
114
114
  let stateObject = $derived({
115
- idle: currentState === IDLE,
115
+ idle: currentState === DRAG_IDLE,
116
116
  dragging: currentState === DRAGGING,
117
117
  'drag-preview': currentState === DRAG_PREVIEW,
118
118
  dropping: currentState === DROPPING,
@@ -295,10 +295,10 @@
295
295
 
296
296
  // Brief dropping state before returning to idle
297
297
  setTimeout(() => {
298
- currentState = IDLE;
298
+ currentState = DRAG_IDLE;
299
299
  }, 100);
300
300
  } else {
301
- currentState = IDLE;
301
+ currentState = DRAG_IDLE;
302
302
  }
303
303
 
304
304
  onDragEnd?.({ event, item, wasDropped });
@@ -321,7 +321,7 @@
321
321
  function handleMouseUp(event) {
322
322
  if (dragTimeout) {
323
323
  clearTimeout(dragTimeout);
324
- currentState = IDLE;
324
+ currentState = DRAG_IDLE;
325
325
  }
326
326
  }
327
327
 
@@ -456,7 +456,7 @@
456
456
 
457
457
  // Clean up
458
458
  touchDragging = false;
459
- currentState = IDLE;
459
+ currentState = DRAG_IDLE;
460
460
  showPreview = false;
461
461
  dragState.end(draggableId);
462
462
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hkdigital/lib-core",
3
- "version": "0.4.14",
3
+ "version": "0.4.15",
4
4
  "author": {
5
5
  "name": "HKdigital",
6
6
  "url": "https://hkdigital.nl"
@@ -1,6 +0,0 @@
1
- export * as bases from "./bases/index.js";
2
- export * as http from "./http/index.js";
3
- export * as mime from "./mime/index.js";
4
- export * as regexp from "./regexp/index.js";
5
- export * as states from "./states/index.js";
6
- export * as time from "./time/index.js";
@@ -1,6 +0,0 @@
1
- export * as bases from './bases/index.js';
2
- export * as http from './http/index.js';
3
- export * as mime from './mime/index.js';
4
- export * as regexp from './regexp/index.js';
5
- export * as states from './states/index.js';
6
- export * as time from './time/index.js';