@strav/jina 0.1.0 → 0.1.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/README.md CHANGED
@@ -1,20 +1,20 @@
1
- # @stravigor/jina
1
+ # @strav/jina
2
2
 
3
- Headless authentication flows for the [Strav](https://www.npmjs.com/package/@stravigor/core) framework. Registration, login, logout, password reset, email verification, two-factor authentication (TOTP), password confirmation, and profile updates — all as JSON API endpoints.
3
+ Headless authentication flows for the [Strav](https://www.npmjs.com/package/@strav/core) framework. Registration, login, logout, password reset, email verification, two-factor authentication (TOTP), password confirmation, and profile updates — all as JSON API endpoints.
4
4
 
5
5
  ## Install
6
6
 
7
7
  ```bash
8
- bun add @stravigor/jina
8
+ bun add @strav/jina
9
9
  bun strav install jina
10
10
  ```
11
11
 
12
- Requires `@stravigor/core` as a peer dependency.
12
+ Requires `@strav/core` as a peer dependency.
13
13
 
14
14
  ## Setup
15
15
 
16
16
  ```ts
17
- import { defineActions } from '@stravigor/jina'
17
+ import { defineActions } from '@strav/jina'
18
18
  import User from './models/user'
19
19
 
20
20
  const actions = defineActions<User>({
@@ -28,7 +28,7 @@ const actions = defineActions<User>({
28
28
  ```
29
29
 
30
30
  ```ts
31
- import { JinaProvider } from '@stravigor/jina'
31
+ import { JinaProvider } from '@strav/jina'
32
32
 
33
33
  app.use(new JinaProvider(actions))
34
34
  ```
@@ -57,7 +57,7 @@ Routes are registered automatically:
57
57
  ## Middleware
58
58
 
59
59
  ```ts
60
- import { verified, confirmed, twoFactorChallenge } from '@stravigor/jina'
60
+ import { verified, confirmed, twoFactorChallenge } from '@strav/jina'
61
61
 
62
62
  router.group({ middleware: [auth(), verified()] }, r => {
63
63
  r.delete('/account', compose([confirmed()], deleteAccountHandler))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strav/jina",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "description": "Headless authentication flows for the Strav framework",
6
6
  "license": "MIT",
package/src/actions.ts CHANGED
@@ -5,7 +5,7 @@ import type { JinaActions } from './types.ts'
5
5
  * Zero runtime cost — just provides autocompletion and type checking.
6
6
  *
7
7
  * @example
8
- * import { defineActions } from '@stravigor/jina'
8
+ * import { defineActions } from '@strav/jina'
9
9
  * import { User } from '../models/user'
10
10
  *
11
11
  * export default defineActions<User>({
package/src/errors.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { StravError } from '@stravigor/kernel'
1
+ import { StravError } from '@strav/kernel'
2
2
 
3
3
  /** Base error for all Jina errors. */
4
4
  export class JinaError extends StravError {}
@@ -1,5 +1,5 @@
1
- import { encrypt, Emitter } from '@stravigor/kernel'
2
- import type { Context, Session } from '@stravigor/http'
1
+ import { encrypt, Emitter } from '@strav/kernel'
2
+ import type { Context, Session } from '@strav/http'
3
3
  import JinaManager from '../jina_manager.ts'
4
4
  import { JinaEvents } from '../types.ts'
5
5
 
@@ -1,6 +1,6 @@
1
- import { mail } from '@stravigor/signal'
2
- import { extractUserId } from '@stravigor/database'
3
- import type { Context } from '@stravigor/http'
1
+ import { mail } from '@strav/signal'
2
+ import { extractUserId } from '@strav/database'
3
+ import type { Context } from '@strav/http'
4
4
  import JinaManager from '../jina_manager.ts'
5
5
  import { createSignedToken } from '../tokens.ts'
6
6
 
@@ -1,6 +1,6 @@
1
- import { encrypt, Emitter } from '@stravigor/kernel'
2
- import { AccessToken } from '@stravigor/http'
3
- import type { Context, Session } from '@stravigor/http'
1
+ import { encrypt, Emitter } from '@strav/kernel'
2
+ import { AccessToken } from '@strav/http'
3
+ import type { Context, Session } from '@strav/http'
4
4
  import JinaManager from '../jina_manager.ts'
5
5
  import { JinaEvents } from '../types.ts'
6
6
 
@@ -1,6 +1,6 @@
1
- import { Emitter } from '@stravigor/kernel'
2
- import { Session } from '@stravigor/http'
3
- import type { Context } from '@stravigor/http'
1
+ import { Emitter } from '@strav/kernel'
2
+ import { Session } from '@strav/http'
3
+ import type { Context } from '@strav/http'
4
4
  import JinaManager from '../jina_manager.ts'
5
5
  import { JinaEvents } from '../types.ts'
6
6
 
@@ -1,6 +1,6 @@
1
- import { Emitter } from '@stravigor/kernel'
2
- import { AccessToken } from '@stravigor/http'
3
- import type { Context, Session } from '@stravigor/http'
1
+ import { Emitter } from '@strav/kernel'
2
+ import { AccessToken } from '@strav/http'
3
+ import type { Context, Session } from '@strav/http'
4
4
  import JinaManager from '../jina_manager.ts'
5
5
  import { ValidationError } from '../errors.ts'
6
6
  import { JinaEvents } from '../types.ts'
@@ -1,5 +1,5 @@
1
- import { Emitter } from '@stravigor/kernel'
2
- import type { Context } from '@stravigor/http'
1
+ import { Emitter } from '@strav/kernel'
2
+ import type { Context } from '@strav/http'
3
3
  import JinaManager from '../jina_manager.ts'
4
4
  import { verifySignedToken } from '../tokens.ts'
5
5
  import { JinaEvents } from '../types.ts'
@@ -1,5 +1,5 @@
1
- import { Emitter } from '@stravigor/kernel'
2
- import type { Context, Session } from '@stravigor/http'
1
+ import { Emitter } from '@strav/kernel'
2
+ import type { Context, Session } from '@strav/http'
3
3
  import JinaManager from '../jina_manager.ts'
4
4
  import { JinaEvents } from '../types.ts'
5
5
  import {
@@ -1,5 +1,5 @@
1
- import { encrypt, Emitter } from '@stravigor/kernel'
2
- import type { Context } from '@stravigor/http'
1
+ import { encrypt, Emitter } from '@strav/kernel'
2
+ import type { Context } from '@strav/http'
3
3
  import JinaManager from '../jina_manager.ts'
4
4
  import { JinaEvents } from '../types.ts'
5
5
 
@@ -1,5 +1,5 @@
1
- import { Emitter } from '@stravigor/kernel'
2
- import type { Context } from '@stravigor/http'
1
+ import { Emitter } from '@strav/kernel'
2
+ import type { Context } from '@strav/http'
3
3
  import JinaManager from '../jina_manager.ts'
4
4
  import { JinaEvents } from '../types.ts'
5
5
 
@@ -1,7 +1,7 @@
1
- import { Emitter } from '@stravigor/kernel'
2
- import { mail } from '@stravigor/signal'
3
- import { extractUserId } from '@stravigor/database'
4
- import type { Context } from '@stravigor/http'
1
+ import { Emitter } from '@strav/kernel'
2
+ import { mail } from '@strav/signal'
3
+ import { extractUserId } from '@strav/database'
4
+ import type { Context } from '@strav/http'
5
5
  import JinaManager from '../jina_manager.ts'
6
6
  import { createSignedToken, verifySignedToken } from '../tokens.ts'
7
7
  import { JinaEvents } from '../types.ts'
package/src/helpers.ts CHANGED
@@ -6,7 +6,7 @@ import { generateSecret, totpUri, verifyTotp, base32Decode, generateRecoveryCode
6
6
  * Jina helper — convenience API for auth flow utilities.
7
7
  *
8
8
  * @example
9
- * import { jina } from '@stravigor/jina'
9
+ * import { jina } from '@strav/jina'
10
10
  *
11
11
  * const token = jina.signedToken({ sub: user.id, typ: 'custom' }, 60)
12
12
  * const payload = jina.verifyToken(token)
@@ -1,6 +1,6 @@
1
- import { inject, Configuration, ConfigurationError } from '@stravigor/kernel'
2
- import { Router, compose, rateLimit, auth, guest, session } from '@stravigor/http'
3
- import type { Handler, Middleware } from '@stravigor/http'
1
+ import { inject, Configuration, ConfigurationError } from '@strav/kernel'
2
+ import { Router, compose, rateLimit, auth, guest, session } from '@strav/http'
3
+ import type { Handler, Middleware } from '@strav/http'
4
4
  import { MissingActionError } from './errors.ts'
5
5
  import type { JinaActions, JinaConfig, Feature } from './types.ts'
6
6
  import { registerHandler } from './handlers/register.ts'
@@ -1,6 +1,6 @@
1
- import { ServiceProvider } from '@stravigor/kernel'
2
- import type { Application } from '@stravigor/kernel'
3
- import { Router } from '@stravigor/http'
1
+ import { ServiceProvider } from '@strav/kernel'
2
+ import type { Application } from '@strav/kernel'
3
+ import { Router } from '@strav/http'
4
4
  import JinaManager from './jina_manager.ts'
5
5
  import type { JinaActions } from './types.ts'
6
6
 
@@ -1,4 +1,4 @@
1
- import type { Session, Middleware } from '@stravigor/http'
1
+ import type { Session, Middleware } from '@strav/http'
2
2
  import JinaManager from '../jina_manager.ts'
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import type { Session, Middleware } from '@stravigor/http'
1
+ import type { Session, Middleware } from '@strav/http'
2
2
  import JinaManager from '../jina_manager.ts'
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import type { Middleware } from '@stravigor/http'
1
+ import type { Middleware } from '@strav/http'
2
2
  import JinaManager from '../jina_manager.ts'
3
3
 
4
4
  /**
package/src/tokens.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { encrypt } from '@stravigor/kernel'
1
+ import { encrypt } from '@strav/kernel'
2
2
 
3
3
  // ---------------------------------------------------------------------------
4
4
  // Signed token payloads
package/src/types.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Context } from '@stravigor/http'
1
+ import type { Context } from '@strav/http'
2
2
 
3
3
  // ---------------------------------------------------------------------------
4
4
  // Feature flags
@@ -1,5 +1,5 @@
1
- import { defineActions } from '@stravigor/jina'
2
- import { encrypt } from '@stravigor/kernel'
1
+ import { defineActions } from '@strav/jina'
2
+ import { encrypt } from '@strav/kernel'
3
3
  // import { User } from '../models/user'
4
4
 
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { env } from '@stravigor/kernel'
1
+ import { env } from '@strav/kernel'
2
2
 
3
3
  export default {
4
4
  // Toggle features on/off. Uncomment to enable.