timeback 0.1.1 → 0.1.3
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 +208 -10
- package/dist/client/adapters/react/index.d.ts +1 -1
- package/dist/client/adapters/react/index.d.ts.map +1 -1
- package/dist/client/adapters/solid/index.d.ts +1 -1
- package/dist/client/adapters/solid/index.d.ts.map +1 -1
- package/dist/client/adapters/solid/index.ts +1 -1
- package/dist/client/adapters/svelte/index.d.ts +1 -1
- package/dist/client/adapters/svelte/index.d.ts.map +1 -1
- package/dist/client/adapters/svelte/index.ts +1 -1
- package/dist/client/adapters/vue/index.d.ts +1 -1
- package/dist/client/adapters/vue/index.d.ts.map +1 -1
- package/dist/client/adapters/vue/index.ts +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/edge.d.ts +13 -0
- package/dist/edge.d.ts.map +1 -0
- package/dist/edge.js +1149 -0
- package/dist/identity.d.ts +14 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +1019 -0
- package/dist/index.d.ts +24 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8987 -145
- package/dist/server/adapters/express.d.ts +9 -5
- package/dist/server/adapters/express.d.ts.map +1 -1
- package/dist/server/adapters/express.js +8854 -93
- package/dist/server/adapters/native.d.ts +7 -5
- package/dist/server/adapters/native.d.ts.map +1 -1
- package/dist/server/adapters/native.js +120 -439
- package/dist/server/adapters/nextjs.d.ts +5 -3
- package/dist/server/adapters/nextjs.d.ts.map +1 -1
- package/dist/server/adapters/nextjs.js +120 -439
- package/dist/server/adapters/nuxt.d.ts +6 -4
- package/dist/server/adapters/nuxt.d.ts.map +1 -1
- package/dist/server/adapters/nuxt.js +8900 -168
- package/dist/server/adapters/solid-start.d.ts +5 -3
- package/dist/server/adapters/solid-start.d.ts.map +1 -1
- package/dist/server/adapters/solid-start.js +8821 -78
- package/dist/server/adapters/svelte-kit.d.ts +5 -3
- package/dist/server/adapters/svelte-kit.d.ts.map +1 -1
- package/dist/server/adapters/svelte-kit.js +134 -463
- package/dist/server/adapters/tanstack-start.d.ts +5 -3
- package/dist/server/adapters/tanstack-start.d.ts.map +1 -1
- package/dist/server/adapters/tanstack-start.js +8794 -44
- package/dist/server/adapters/types.d.ts +25 -11
- package/dist/server/adapters/types.d.ts.map +1 -1
- package/dist/server/adapters/utils.d.ts +66 -5
- package/dist/server/adapters/utils.d.ts.map +1 -1
- package/dist/server/handlers/activity.d.ts +1 -1
- package/dist/server/handlers/activity.d.ts.map +1 -1
- package/dist/server/handlers/identity-full.d.ts +28 -0
- package/dist/server/handlers/identity-full.d.ts.map +1 -0
- package/dist/server/handlers/identity-only.d.ts +22 -0
- package/dist/server/handlers/identity-only.d.ts.map +1 -0
- package/dist/server/handlers/index.d.ts +1 -1
- package/dist/server/handlers/index.d.ts.map +1 -1
- package/dist/server/handlers/user.d.ts +1 -1
- package/dist/server/handlers/user.d.ts.map +1 -1
- package/dist/server/index.d.ts +3 -4
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/lib/index.d.ts +2 -1
- package/dist/server/lib/index.d.ts.map +1 -1
- package/dist/server/lib/resolve-timeback-user.d.ts +42 -0
- package/dist/server/lib/resolve-timeback-user.d.ts.map +1 -0
- package/dist/server/lib/utils.d.ts +15 -0
- package/dist/server/lib/utils.d.ts.map +1 -1
- package/dist/server/timeback-identity.d.ts +19 -0
- package/dist/server/timeback-identity.d.ts.map +1 -0
- package/dist/server/timeback.d.ts +33 -13
- package/dist/server/timeback.d.ts.map +1 -1
- package/dist/server/types.d.ts +135 -33
- package/dist/server/types.d.ts.map +1 -1
- package/dist/shared/types.d.ts +49 -5
- package/dist/shared/types.d.ts.map +1 -1
- package/package.json +10 -1
- package/dist/server/handlers/identity.d.ts +0 -24
- package/dist/server/handlers/identity.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -19,7 +19,9 @@ TypeScript SDK for integrating Timeback into your application. Provides server-s
|
|
|
19
19
|
- [Svelte](#svelte)
|
|
20
20
|
- [Solid](#solid)
|
|
21
21
|
- [Identity Modes](#identity-modes)
|
|
22
|
+
- [Identity-Only Integration](#identity-only-integration)
|
|
22
23
|
- [Activity Tracking](#activity-tracking)
|
|
24
|
+
- [Advanced: Direct API Access](#advanced-direct-api-access)
|
|
23
25
|
|
|
24
26
|
## Installation
|
|
25
27
|
|
|
@@ -42,10 +44,10 @@ All server adapters use the same core configuration:
|
|
|
42
44
|
|
|
43
45
|
```typescript
|
|
44
46
|
// lib/timeback.ts
|
|
45
|
-
import {
|
|
47
|
+
import { createTimeback } from 'timeback'
|
|
46
48
|
|
|
47
|
-
export const timeback = await
|
|
48
|
-
env: 'staging', // '
|
|
49
|
+
export const timeback = await createTimeback({
|
|
50
|
+
env: 'staging', // 'local' | 'staging' | 'production'
|
|
49
51
|
api: {
|
|
50
52
|
clientId: process.env.TIMEBACK_API_CLIENT_ID!,
|
|
51
53
|
clientSecret: process.env.TIMEBACK_API_CLIENT_SECRET!,
|
|
@@ -55,9 +57,10 @@ export const timeback = await createServer({
|
|
|
55
57
|
clientId: process.env.AWS_COGNITO_CLIENT_ID!,
|
|
56
58
|
clientSecret: process.env.AWS_COGNITO_CLIENT_SECRET!,
|
|
57
59
|
redirectUri: 'http://localhost:3000/api/auth/sso/callback/timeback',
|
|
58
|
-
onCallbackSuccess: ({ user, redirect }) => {
|
|
59
|
-
//
|
|
60
|
-
|
|
60
|
+
onCallbackSuccess: async ({ user, state, redirect }) => {
|
|
61
|
+
// user.id is the timebackId (canonical stable identifier)
|
|
62
|
+
await setSession({ id: user.id, email: user.email })
|
|
63
|
+
return redirect(state?.returnTo ?? '/')
|
|
61
64
|
},
|
|
62
65
|
onCallbackError: ({ error, redirect }) => {
|
|
63
66
|
console.error('SSO Error:', error)
|
|
@@ -327,7 +330,7 @@ function MyComponent() {
|
|
|
327
330
|
|
|
328
331
|
### SSO Mode
|
|
329
332
|
|
|
330
|
-
Uses Timeback as the identity provider via OIDC
|
|
333
|
+
Uses Timeback as the identity provider via OIDC. When using `createTimeback()`, the SDK automatically resolves the Timeback user by email and returns an enriched `TimebackAuthUser` with `user.id` being the canonical `timebackId` (stable identifier).
|
|
331
334
|
|
|
332
335
|
```typescript
|
|
333
336
|
identity: {
|
|
@@ -335,12 +338,62 @@ identity: {
|
|
|
335
338
|
clientId: process.env.AWS_COGNITO_CLIENT_ID!,
|
|
336
339
|
clientSecret: process.env.AWS_COGNITO_CLIENT_SECRET!,
|
|
337
340
|
redirectUri: 'http://localhost:3000/api/auth/sso/callback/timeback',
|
|
338
|
-
onCallbackSuccess: ({ user, state, redirect }) =>
|
|
339
|
-
|
|
341
|
+
onCallbackSuccess: async ({ user, idp, state, redirect }) => {
|
|
342
|
+
// user.id is the timebackId (canonical stable identifier)
|
|
343
|
+
// user.email, user.name come from Timeback profile
|
|
344
|
+
// user.claims contains IdP data (sub, firstName, lastName, pictureUrl)
|
|
345
|
+
// idp.tokens and idp.userInfo contain raw OIDC data if needed
|
|
346
|
+
await setSession({ id: user.id, email: user.email })
|
|
347
|
+
return redirect(state?.returnTo ?? '/')
|
|
348
|
+
},
|
|
349
|
+
onCallbackError: ({ error, errorCode, redirect }) => {
|
|
350
|
+
// errorCode may be: missing_email, timeback_user_not_found,
|
|
351
|
+
// timeback_user_ambiguous, timeback_user_lookup_failed
|
|
352
|
+
console.error('SSO Error:', errorCode, error.message)
|
|
353
|
+
return redirect('/?error=sso_failed')
|
|
354
|
+
},
|
|
340
355
|
getUser: () => getCurrentSession(),
|
|
341
356
|
}
|
|
342
357
|
```
|
|
343
358
|
|
|
359
|
+
#### TimebackAuthUser Shape
|
|
360
|
+
|
|
361
|
+
The `user` in `onCallbackSuccess` is a `TimebackAuthUser` with this structure:
|
|
362
|
+
|
|
363
|
+
```typescript
|
|
364
|
+
interface TimebackAuthUser {
|
|
365
|
+
id: string // Timeback user ID
|
|
366
|
+
email: string
|
|
367
|
+
name?: string
|
|
368
|
+
school?: { id: string; name: string }
|
|
369
|
+
grade?: number
|
|
370
|
+
claims: {
|
|
371
|
+
sub: string // OIDC subject identifier
|
|
372
|
+
email: string
|
|
373
|
+
firstName?: string
|
|
374
|
+
lastName?: string
|
|
375
|
+
pictureUrl?: string
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
#### Session Storage Guidance
|
|
381
|
+
|
|
382
|
+
For cookie-only sessions, store only the minimal payload to avoid cookie size limits:
|
|
383
|
+
|
|
384
|
+
```typescript
|
|
385
|
+
// Recommended: store minimal session
|
|
386
|
+
await setSession({ id: user.id, email: user.email })
|
|
387
|
+
|
|
388
|
+
// Then in getUser, return what you stored:
|
|
389
|
+
getUser: req => {
|
|
390
|
+
const session = getSessionFromCookie(req)
|
|
391
|
+
return session ? { id: session.id, email: session.email } : undefined
|
|
392
|
+
}
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
For DB-backed sessions, you can store the full `TimebackAuthUser` if desired.
|
|
396
|
+
|
|
344
397
|
### Custom Mode
|
|
345
398
|
|
|
346
399
|
For apps with existing auth (Clerk, Auth0, Supabase, etc.):
|
|
@@ -351,11 +404,92 @@ identity: {
|
|
|
351
404
|
getUser: async (req) => {
|
|
352
405
|
const session = await getSession(req)
|
|
353
406
|
if (!session) return undefined
|
|
354
|
-
|
|
407
|
+
// Return user with timebackId as the id
|
|
408
|
+
return { id: session.timebackId, email: session.email, name: session.name }
|
|
355
409
|
},
|
|
356
410
|
}
|
|
357
411
|
```
|
|
358
412
|
|
|
413
|
+
## Identity-Only Integration
|
|
414
|
+
|
|
415
|
+
If you only need Timeback SSO authentication without activity tracking or Timeback API integration, use `createTimebackIdentity()`. This is a lightweight alternative that:
|
|
416
|
+
|
|
417
|
+
- Does not require Timeback API credentials
|
|
418
|
+
- Does not require `timeback.config.ts`
|
|
419
|
+
- Only exposes identity routes (sign-in, callback, sign-out)
|
|
420
|
+
- Returns raw OIDC user info (no Timeback profile enrichment)
|
|
421
|
+
|
|
422
|
+
**Note:** Unlike `createTimeback()`, the identity-only callback returns raw OIDC user info (`sub`, `email`, `name`, etc.) without resolving a Timeback user. Use `createTimeback()` if you need the canonical `timebackId`.
|
|
423
|
+
|
|
424
|
+
### Cloudflare Workers / workerd compatibility
|
|
425
|
+
|
|
426
|
+
`createTimebackIdentity()` is runtime-agnostic, but the main `timeback` entrypoint also includes
|
|
427
|
+
Node-oriented functionality (notably config loading via `jiti`). Some edge runtimes
|
|
428
|
+
(Cloudflare Workers / workerd) do not support the Node modules that `jiti` depends on.
|
|
429
|
+
|
|
430
|
+
If you're deploying identity-only SSO on Workers/workerd, import from the worker-safe entrypoint:
|
|
431
|
+
|
|
432
|
+
```ts
|
|
433
|
+
import { createTimebackIdentity, toNativeHandler } from 'timeback/edge'
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
### Server Setup
|
|
437
|
+
|
|
438
|
+
```typescript
|
|
439
|
+
// lib/timeback.ts
|
|
440
|
+
import { createTimebackIdentity } from 'timeback'
|
|
441
|
+
|
|
442
|
+
export const timeback = createTimebackIdentity({
|
|
443
|
+
env: 'production',
|
|
444
|
+
identity: {
|
|
445
|
+
mode: 'sso',
|
|
446
|
+
clientId: process.env.AWS_COGNITO_CLIENT_ID!,
|
|
447
|
+
clientSecret: process.env.AWS_COGNITO_CLIENT_SECRET!,
|
|
448
|
+
onCallbackSuccess: async ({ user, tokens, redirect }) => {
|
|
449
|
+
// user is raw OIDC userInfo (sub, email, name, picture, etc.)
|
|
450
|
+
// No Timeback profile enrichment in identity-only mode
|
|
451
|
+
await createSession({
|
|
452
|
+
sub: user.sub,
|
|
453
|
+
email: user.email,
|
|
454
|
+
name: user.name,
|
|
455
|
+
})
|
|
456
|
+
return redirect('/')
|
|
457
|
+
},
|
|
458
|
+
onCallbackError: ({ error, redirect }) => {
|
|
459
|
+
console.error('SSO Error:', error)
|
|
460
|
+
return redirect('/login?error=sso_failed')
|
|
461
|
+
},
|
|
462
|
+
getUser: req => getSessionFromRequest(req),
|
|
463
|
+
},
|
|
464
|
+
})
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
### Next.js
|
|
468
|
+
|
|
469
|
+
```typescript
|
|
470
|
+
// app/api/timeback/[...timeback]/route.ts
|
|
471
|
+
import { toNextjsHandler } from 'timeback/nextjs'
|
|
472
|
+
|
|
473
|
+
import { timeback } from '@/lib/timeback'
|
|
474
|
+
|
|
475
|
+
export const { GET, POST } = toNextjsHandler(timeback)
|
|
476
|
+
```
|
|
477
|
+
|
|
478
|
+
### Express
|
|
479
|
+
|
|
480
|
+
```typescript
|
|
481
|
+
// server.ts
|
|
482
|
+
import express from 'express'
|
|
483
|
+
import { toExpressMiddleware } from 'timeback/express'
|
|
484
|
+
|
|
485
|
+
import { timeback } from './lib/timeback'
|
|
486
|
+
|
|
487
|
+
const app = express()
|
|
488
|
+
app.use('/api/timeback', toExpressMiddleware(timeback))
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
All other framework adapters (Nuxt, SvelteKit, SolidStart, TanStack Start) work identically with identity-only instances.
|
|
492
|
+
|
|
359
493
|
## Activity Tracking
|
|
360
494
|
|
|
361
495
|
Activities track time spent on learning content:
|
|
@@ -384,3 +518,67 @@ await activity.end({
|
|
|
384
518
|
```
|
|
385
519
|
|
|
386
520
|
The SDK automatically sends activity data to your server, which forwards it to the Timeback API.
|
|
521
|
+
|
|
522
|
+
## Advanced: Direct API Access
|
|
523
|
+
|
|
524
|
+
For advanced use cases that need to call Timeback services (OneRoster, Edubridge, Caliper, QTI) beyond what the SDK handlers provide, use `timeback.api`:
|
|
525
|
+
|
|
526
|
+
```typescript
|
|
527
|
+
// Access via the timeback instance (lazy-initialized on first access)
|
|
528
|
+
const { data: users } = await timeback.api.oneroster.users.list({
|
|
529
|
+
limit: 10,
|
|
530
|
+
where: { role: 'student' },
|
|
531
|
+
})
|
|
532
|
+
|
|
533
|
+
// Access any Timeback service
|
|
534
|
+
const { data: orgs } = await timeback.api.oneroster.orgs.list()
|
|
535
|
+
await timeback.api.caliper.emit(caliperEvent)
|
|
536
|
+
```
|
|
537
|
+
|
|
538
|
+
### Access Patterns
|
|
539
|
+
|
|
540
|
+
```typescript
|
|
541
|
+
// lib/timeback.ts
|
|
542
|
+
import { createTimeback } from 'timeback'
|
|
543
|
+
|
|
544
|
+
export const timeback = await createTimeback({
|
|
545
|
+
env: 'staging',
|
|
546
|
+
api: {
|
|
547
|
+
clientId: process.env.TIMEBACK_API_CLIENT_ID!,
|
|
548
|
+
clientSecret: process.env.TIMEBACK_API_CLIENT_SECRET!,
|
|
549
|
+
},
|
|
550
|
+
identity: { mode: 'custom', getUser: () => getSession() },
|
|
551
|
+
})
|
|
552
|
+
|
|
553
|
+
// Access the API client via timeback.api
|
|
554
|
+
const { data: users } = await timeback.api.oneroster.users.list()
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
```typescript
|
|
558
|
+
// Elsewhere in your app
|
|
559
|
+
import { timeback } from './lib/timeback'
|
|
560
|
+
|
|
561
|
+
// The client is available at timeback.api
|
|
562
|
+
const { data: orgs } = await timeback.api.oneroster.orgs.list()
|
|
563
|
+
```
|
|
564
|
+
|
|
565
|
+
### Environment Mapping
|
|
566
|
+
|
|
567
|
+
The SDK's `env` config controls runtime mode, but for outbound API calls:
|
|
568
|
+
|
|
569
|
+
| SDK `env` | API calls use |
|
|
570
|
+
| ------------ | ------------- |
|
|
571
|
+
| `local` | `staging` |
|
|
572
|
+
| `staging` | `staging` |
|
|
573
|
+
| `production` | `production` |
|
|
574
|
+
|
|
575
|
+
This means `env: 'local'` uses staging Timeback services, so you can develop locally against real (staging) data without additional configuration.
|
|
576
|
+
|
|
577
|
+
### When to Use
|
|
578
|
+
|
|
579
|
+
- Fetching data not exposed by SDK handlers (e.g., listing orgs, courses, enrollments)
|
|
580
|
+
- Emitting custom Caliper events
|
|
581
|
+
- Building admin dashboards or reporting tools
|
|
582
|
+
- Any direct Timeback API integration
|
|
583
|
+
|
|
584
|
+
**Note:** `timeback.api` is only available on the full SDK (`createTimeback()`), not on identity-only instances (`createTimebackIdentity()`).
|
|
@@ -39,5 +39,5 @@ export { Activity } from '../../lib/activity';
|
|
|
39
39
|
export { TimebackProvider, useTimeback } from './provider';
|
|
40
40
|
export { SignInButton } from './SignInButton';
|
|
41
41
|
export type { SignInButtonProps } from './SignInButton';
|
|
42
|
-
export type {
|
|
42
|
+
export type { TimebackIdentity, ActivityParams, ActivityMetrics } from '../../../shared/types';
|
|
43
43
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/client/adapters/react/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAG5D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAG7C,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAG1D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAGvD,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/client/adapters/react/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAG5D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAG7C,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAG1D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAGvD,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA"}
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
* ```
|
|
35
35
|
*/
|
|
36
36
|
export { Activity, createClient, TimebackClient } from 'timeback/client';
|
|
37
|
-
export type { ActivityMetrics, ActivityParams,
|
|
37
|
+
export type { ActivityMetrics, ActivityParams, TimebackIdentity } from 'timeback/client';
|
|
38
38
|
export { TimebackProvider, useTimeback } from './context';
|
|
39
39
|
export type { TimebackProviderProps } from './context';
|
|
40
40
|
export { SignInButton } from './SignInButton';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/client/adapters/solid/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACxE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/client/adapters/solid/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACxE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAGxF,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AACzD,YAAY,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAA;AAGtD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
*/
|
|
36
36
|
|
|
37
37
|
export { Activity, createClient, TimebackClient } from 'timeback/client'
|
|
38
|
-
export type { ActivityMetrics, ActivityParams,
|
|
38
|
+
export type { ActivityMetrics, ActivityParams, TimebackIdentity } from 'timeback/client'
|
|
39
39
|
|
|
40
40
|
// Solid-specific
|
|
41
41
|
export { TimebackProvider, useTimeback } from './context'
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* ```
|
|
27
27
|
*/
|
|
28
28
|
export { Activity, createClient, TimebackClient } from 'timeback/client';
|
|
29
|
-
export type { ActivityMetrics, ActivityParams,
|
|
29
|
+
export type { ActivityMetrics, ActivityParams, TimebackIdentity } from 'timeback/client';
|
|
30
30
|
export { initTimeback, timeback } from './stores';
|
|
31
31
|
export { default as SignInButton } from './SignInButton.svelte';
|
|
32
32
|
export type { SignInButtonProps } from './SignInButton.svelte';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/client/adapters/svelte/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACxE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/client/adapters/svelte/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACxE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAGxF,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAGjD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAC/D,YAAY,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA"}
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
|
|
29
29
|
// Re-export from timeback/client for convenience
|
|
30
30
|
export { Activity, createClient, TimebackClient } from 'timeback/client'
|
|
31
|
-
export type { ActivityMetrics, ActivityParams,
|
|
31
|
+
export type { ActivityMetrics, ActivityParams, TimebackIdentity } from 'timeback/client'
|
|
32
32
|
|
|
33
33
|
// Svelte-specific
|
|
34
34
|
export { initTimeback, timeback } from './stores'
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
* ```
|
|
37
37
|
*/
|
|
38
38
|
export { Activity, createClient, TimebackClient } from 'timeback/client';
|
|
39
|
-
export type { ActivityMetrics, ActivityParams,
|
|
39
|
+
export type { ActivityMetrics, ActivityParams, TimebackIdentity } from 'timeback/client';
|
|
40
40
|
export { TimebackProvider, useTimeback } from './provider';
|
|
41
41
|
export { default as SignInButton } from './SignInButton.vue';
|
|
42
42
|
export type { SignInButtonProps } from './SignInButton.vue';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/client/adapters/vue/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAGH,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACxE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/client/adapters/vue/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAGH,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACxE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAGxF,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAG1D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAC5D,YAAY,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA"}
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
|
|
39
39
|
// Re-export from timeback/client for convenience
|
|
40
40
|
export { Activity, createClient, TimebackClient } from 'timeback/client'
|
|
41
|
-
export type { ActivityMetrics, ActivityParams,
|
|
41
|
+
export type { ActivityMetrics, ActivityParams, TimebackIdentity } from 'timeback/client'
|
|
42
42
|
|
|
43
43
|
// Vue-specific
|
|
44
44
|
export { TimebackProvider, useTimeback } from './provider'
|
package/dist/client.d.ts
CHANGED
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
*/
|
|
27
27
|
export { createClient, TimebackClient } from './client/index';
|
|
28
28
|
export { createActivity, Activity } from './client/index';
|
|
29
|
-
export type {
|
|
29
|
+
export type { TimebackIdentity, TimebackProfile, TimebackSessionUser, ActivityParams, ActivityMetrics, } from './shared/types';
|
|
30
30
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC7D,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzD,YAAY,EACX,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC7D,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzD,YAAY,EACX,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,eAAe,GACf,MAAM,gBAAgB,CAAA"}
|
package/dist/edge.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Timeback (edge/worker friendly entrypoint)
|
|
3
|
+
*
|
|
4
|
+
* This entrypoint is intended for runtimes like Cloudflare Workers / workerd.
|
|
5
|
+
* It avoids importing Node-only dependencies (notably config loading via `jiti`).
|
|
6
|
+
*
|
|
7
|
+
* It includes identity-only SSO plus a small set of edge-safe helpers.
|
|
8
|
+
*/
|
|
9
|
+
export { createTimebackIdentity } from './server/timeback-identity';
|
|
10
|
+
export type { IdentityOnlyConfig, IdentityOnlyInstance, IdentityOnlyHandlers } from './server';
|
|
11
|
+
export { toNativeHandler } from './server/adapters/native';
|
|
12
|
+
export { ROUTES } from './shared/constants';
|
|
13
|
+
//# sourceMappingURL=edge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edge.d.ts","sourceRoot":"","sources":["../src/edge.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAA;AACnE,YAAY,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAE9F,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA"}
|