timeback 0.1.2 → 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 +152 -15
- 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 +8 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8979 -150
- package/dist/server/adapters/express.d.ts +2 -2
- package/dist/server/adapters/express.d.ts.map +1 -1
- package/dist/server/adapters/express.js +8827 -82
- package/dist/server/adapters/native.d.ts +3 -3
- package/dist/server/adapters/native.d.ts.map +1 -1
- package/dist/server/adapters/native.js +114 -441
- package/dist/server/adapters/nextjs.d.ts +1 -1
- package/dist/server/adapters/nextjs.js +114 -441
- package/dist/server/adapters/nuxt.d.ts +1 -1
- package/dist/server/adapters/nuxt.d.ts.map +1 -1
- package/dist/server/adapters/nuxt.js +8899 -177
- package/dist/server/adapters/solid-start.d.ts +1 -1
- package/dist/server/adapters/solid-start.d.ts.map +1 -1
- package/dist/server/adapters/solid-start.js +8819 -86
- package/dist/server/adapters/svelte-kit.d.ts +1 -1
- package/dist/server/adapters/svelte-kit.d.ts.map +1 -1
- package/dist/server/adapters/svelte-kit.js +130 -469
- package/dist/server/adapters/tanstack-start.d.ts +1 -1
- package/dist/server/adapters/tanstack-start.d.ts.map +1 -1
- package/dist/server/adapters/tanstack-start.js +8793 -51
- package/dist/server/adapters/utils.d.ts +42 -0
- 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 +25 -42
- package/dist/server/timeback.d.ts.map +1 -1
- package/dist/server/types.d.ts +100 -35
- 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
|
@@ -21,6 +21,7 @@ TypeScript SDK for integrating Timeback into your application. Provides server-s
|
|
|
21
21
|
- [Identity Modes](#identity-modes)
|
|
22
22
|
- [Identity-Only Integration](#identity-only-integration)
|
|
23
23
|
- [Activity Tracking](#activity-tracking)
|
|
24
|
+
- [Advanced: Direct API Access](#advanced-direct-api-access)
|
|
24
25
|
|
|
25
26
|
## Installation
|
|
26
27
|
|
|
@@ -43,10 +44,10 @@ All server adapters use the same core configuration:
|
|
|
43
44
|
|
|
44
45
|
```typescript
|
|
45
46
|
// lib/timeback.ts
|
|
46
|
-
import {
|
|
47
|
+
import { createTimeback } from 'timeback'
|
|
47
48
|
|
|
48
|
-
export const timeback = await
|
|
49
|
-
env: 'staging', // '
|
|
49
|
+
export const timeback = await createTimeback({
|
|
50
|
+
env: 'staging', // 'local' | 'staging' | 'production'
|
|
50
51
|
api: {
|
|
51
52
|
clientId: process.env.TIMEBACK_API_CLIENT_ID!,
|
|
52
53
|
clientSecret: process.env.TIMEBACK_API_CLIENT_SECRET!,
|
|
@@ -56,9 +57,10 @@ export const timeback = await createServer({
|
|
|
56
57
|
clientId: process.env.AWS_COGNITO_CLIENT_ID!,
|
|
57
58
|
clientSecret: process.env.AWS_COGNITO_CLIENT_SECRET!,
|
|
58
59
|
redirectUri: 'http://localhost:3000/api/auth/sso/callback/timeback',
|
|
59
|
-
onCallbackSuccess: ({ user, redirect }) => {
|
|
60
|
-
//
|
|
61
|
-
|
|
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 ?? '/')
|
|
62
64
|
},
|
|
63
65
|
onCallbackError: ({ error, redirect }) => {
|
|
64
66
|
console.error('SSO Error:', error)
|
|
@@ -328,7 +330,7 @@ function MyComponent() {
|
|
|
328
330
|
|
|
329
331
|
### SSO Mode
|
|
330
332
|
|
|
331
|
-
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).
|
|
332
334
|
|
|
333
335
|
```typescript
|
|
334
336
|
identity: {
|
|
@@ -336,12 +338,62 @@ identity: {
|
|
|
336
338
|
clientId: process.env.AWS_COGNITO_CLIENT_ID!,
|
|
337
339
|
clientSecret: process.env.AWS_COGNITO_CLIENT_SECRET!,
|
|
338
340
|
redirectUri: 'http://localhost:3000/api/auth/sso/callback/timeback',
|
|
339
|
-
onCallbackSuccess: ({ user, state, redirect }) =>
|
|
340
|
-
|
|
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
|
+
},
|
|
341
355
|
getUser: () => getCurrentSession(),
|
|
342
356
|
}
|
|
343
357
|
```
|
|
344
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
|
+
|
|
345
397
|
### Custom Mode
|
|
346
398
|
|
|
347
399
|
For apps with existing auth (Clerk, Auth0, Supabase, etc.):
|
|
@@ -352,34 +404,55 @@ identity: {
|
|
|
352
404
|
getUser: async (req) => {
|
|
353
405
|
const session = await getSession(req)
|
|
354
406
|
if (!session) return undefined
|
|
355
|
-
|
|
407
|
+
// Return user with timebackId as the id
|
|
408
|
+
return { id: session.timebackId, email: session.email, name: session.name }
|
|
356
409
|
},
|
|
357
410
|
}
|
|
358
411
|
```
|
|
359
412
|
|
|
360
413
|
## Identity-Only Integration
|
|
361
414
|
|
|
362
|
-
If you only need Timeback SSO authentication without activity tracking or Timeback API integration, use `
|
|
415
|
+
If you only need Timeback SSO authentication without activity tracking or Timeback API integration, use `createTimebackIdentity()`. This is a lightweight alternative that:
|
|
363
416
|
|
|
364
417
|
- Does not require Timeback API credentials
|
|
365
418
|
- Does not require `timeback.config.ts`
|
|
366
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
|
+
```
|
|
367
435
|
|
|
368
436
|
### Server Setup
|
|
369
437
|
|
|
370
438
|
```typescript
|
|
371
439
|
// lib/timeback.ts
|
|
372
|
-
import {
|
|
440
|
+
import { createTimebackIdentity } from 'timeback'
|
|
373
441
|
|
|
374
|
-
export const timeback =
|
|
442
|
+
export const timeback = createTimebackIdentity({
|
|
375
443
|
env: 'production',
|
|
376
444
|
identity: {
|
|
377
445
|
mode: 'sso',
|
|
378
446
|
clientId: process.env.AWS_COGNITO_CLIENT_ID!,
|
|
379
447
|
clientSecret: process.env.AWS_COGNITO_CLIENT_SECRET!,
|
|
380
448
|
onCallbackSuccess: async ({ user, tokens, redirect }) => {
|
|
381
|
-
//
|
|
382
|
-
|
|
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
|
+
})
|
|
383
456
|
return redirect('/')
|
|
384
457
|
},
|
|
385
458
|
onCallbackError: ({ error, redirect }) => {
|
|
@@ -445,3 +518,67 @@ await activity.end({
|
|
|
445
518
|
```
|
|
446
519
|
|
|
447
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"}
|