@timeback/sdk 0.1.9 → 0.1.11
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 +10 -8
- package/dist/chunk-1cqa51je.js +2 -0
- package/dist/chunk-3ew9vn2d.js +2 -0
- package/dist/chunk-6b0ppq9d.js +2 -0
- package/dist/chunk-92nnwa7t.js +2 -0
- package/dist/chunk-bavxzt1k.js +2 -0
- package/dist/chunk-c8pw96sp.js +10 -0
- package/dist/chunk-edk3nfj7.js +2 -0
- package/dist/chunk-g67efaph.js +4 -0
- package/dist/chunk-pd91g539.js +1 -0
- package/dist/chunk-sgcwg4j6.js +1 -0
- package/dist/client/adapters/react/hooks/types.d.ts +2 -29
- package/dist/client/adapters/react/hooks/types.d.ts.map +1 -1
- package/dist/client/adapters/react/hooks/useTimebackVerification.d.ts.map +1 -1
- package/dist/client/adapters/react/index.js +2 -2
- package/dist/client/adapters/solid/types.d.ts +2 -29
- package/dist/client/adapters/solid/types.d.ts.map +1 -1
- package/dist/client/adapters/solid/types.ts +2 -18
- package/dist/client/adapters/svelte/stores/client.d.ts.map +1 -1
- package/dist/client/adapters/svelte/stores/client.ts +2 -9
- package/dist/client/adapters/svelte/stores/profile.d.ts +1 -1
- package/dist/client/adapters/svelte/stores/profile.d.ts.map +1 -1
- package/dist/client/adapters/svelte/stores/profile.ts +4 -11
- package/dist/client/adapters/svelte/stores/verification.d.ts.map +1 -1
- package/dist/client/adapters/svelte/stores/verification.ts +1 -10
- package/dist/client/adapters/svelte/types.d.ts +1 -29
- package/dist/client/adapters/svelte/types.d.ts.map +1 -1
- package/dist/client/adapters/vue/provider.d.ts.map +1 -1
- package/dist/client/adapters/vue/provider.ts +4 -11
- package/dist/client/adapters/vue/types.d.ts +2 -29
- package/dist/client/adapters/vue/types.d.ts.map +1 -1
- package/dist/client/adapters/vue/types.ts +2 -18
- package/dist/client/auth/types.d.ts +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/lib/activity/activity.class.d.ts +130 -22
- package/dist/client/lib/activity/activity.class.d.ts.map +1 -1
- package/dist/client/lib/activity/transport.d.ts +15 -0
- package/dist/client/lib/activity/transport.d.ts.map +1 -0
- package/dist/client/lib/activity/types.d.ts +53 -0
- package/dist/client/lib/activity/types.d.ts.map +1 -0
- package/dist/client/lib/utils.d.ts +18 -0
- package/dist/client/lib/utils.d.ts.map +1 -1
- package/dist/client/lib/utils.ts +109 -0
- package/dist/client/namespaces/activity.d.ts +49 -7
- package/dist/client/namespaces/activity.d.ts.map +1 -1
- package/dist/client/timeback-client.class.d.ts +7 -1
- package/dist/client/timeback-client.class.d.ts.map +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.js +1 -1
- package/dist/identity.d.ts +2 -5
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +1 -1
- package/dist/index.d.ts +7 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +30 -21
- package/dist/server/adapters/express.d.ts.map +1 -1
- package/dist/server/adapters/express.js +1 -1
- package/dist/server/adapters/native.d.ts.map +1 -1
- package/dist/server/adapters/native.js +2 -2
- package/dist/server/adapters/nextjs.js +1 -1
- package/dist/server/adapters/nuxt.d.ts.map +1 -1
- package/dist/server/adapters/nuxt.js +1 -1
- package/dist/server/adapters/solid-start.d.ts.map +1 -1
- package/dist/server/adapters/solid-start.js +1 -1
- package/dist/server/adapters/svelte-kit.d.ts.map +1 -1
- package/dist/server/adapters/svelte-kit.js +1 -1
- package/dist/server/adapters/tanstack-start.d.ts.map +1 -1
- package/dist/server/adapters/tanstack-start.js +1 -1
- package/dist/server/adapters/types.d.ts +16 -4
- package/dist/server/adapters/types.d.ts.map +1 -1
- package/dist/server/adapters/utils.d.ts +1 -1
- package/dist/server/adapters/utils.d.ts.map +1 -1
- package/dist/server/handlers/activity/attempts.d.ts +1 -1
- package/dist/server/handlers/activity/attempts.d.ts.map +1 -1
- package/dist/server/handlers/activity/caliper.d.ts +54 -16
- package/dist/server/handlers/activity/caliper.d.ts.map +1 -1
- package/dist/server/handlers/activity/heartbeat-handler.d.ts +15 -0
- package/dist/server/handlers/activity/heartbeat-handler.d.ts.map +1 -0
- package/dist/server/handlers/activity/index.d.ts +5 -3
- package/dist/server/handlers/activity/index.d.ts.map +1 -1
- package/dist/server/handlers/activity/progress.d.ts +2 -2
- package/dist/server/handlers/activity/progress.d.ts.map +1 -1
- package/dist/server/handlers/activity/schema.d.ts +40 -6
- package/dist/server/handlers/activity/schema.d.ts.map +1 -1
- package/dist/server/handlers/activity/submit-handler.d.ts +29 -0
- package/dist/server/handlers/activity/submit-handler.d.ts.map +1 -0
- package/dist/server/handlers/activity/submit.d.ts +44 -0
- package/dist/server/handlers/activity/submit.d.ts.map +1 -0
- package/dist/server/handlers/activity/types.d.ts +126 -5
- package/dist/server/handlers/activity/types.d.ts.map +1 -1
- package/dist/server/handlers/identity/handler.d.ts +23 -4
- package/dist/server/handlers/identity/handler.d.ts.map +1 -1
- package/dist/server/handlers/identity/index.d.ts +2 -2
- package/dist/server/handlers/identity/index.d.ts.map +1 -1
- package/dist/server/handlers/identity/oidc.d.ts.map +1 -1
- package/dist/server/handlers/identity/types.d.ts +0 -6
- package/dist/server/handlers/identity/types.d.ts.map +1 -1
- package/dist/server/handlers/index.d.ts +3 -3
- package/dist/server/handlers/index.d.ts.map +1 -1
- package/dist/server/handlers/user/handler.d.ts.map +1 -1
- package/dist/server/handlers/user/profile.d.ts.map +1 -1
- package/dist/server/handlers/user/types.d.ts +3 -0
- package/dist/server/handlers/user/types.d.ts.map +1 -1
- package/dist/server/handlers/user/verify.d.ts.map +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/lib/hooks.d.ts +20 -0
- package/dist/server/lib/hooks.d.ts.map +1 -0
- package/dist/server/lib/index.d.ts +4 -2
- package/dist/server/lib/index.d.ts.map +1 -1
- package/dist/server/lib/logger.d.ts +36 -9
- package/dist/server/lib/logger.d.ts.map +1 -1
- package/dist/server/lib/resolve.d.ts +1 -1
- package/dist/server/lib/resolve.d.ts.map +1 -1
- package/dist/server/lib/utils.d.ts +23 -2
- package/dist/server/lib/utils.d.ts.map +1 -1
- package/dist/server/lib/validation.d.ts +55 -0
- package/dist/server/lib/validation.d.ts.map +1 -0
- package/dist/server/namespaces/activity/index.d.ts +8 -0
- package/dist/server/namespaces/activity/index.d.ts.map +1 -0
- package/dist/server/namespaces/activity/record.d.ts +49 -0
- package/dist/server/namespaces/activity/record.d.ts.map +1 -0
- package/dist/server/namespaces/activity/schema.d.ts +50 -0
- package/dist/server/namespaces/activity/schema.d.ts.map +1 -0
- package/dist/server/namespaces/user/get-profile.d.ts +32 -0
- package/dist/server/namespaces/user/get-profile.d.ts.map +1 -0
- package/dist/server/namespaces/user/index.d.ts +8 -0
- package/dist/server/namespaces/user/index.d.ts.map +1 -0
- package/dist/server/namespaces/user/verify.d.ts +28 -0
- package/dist/server/namespaces/user/verify.d.ts.map +1 -0
- package/dist/server/timeback-identity.d.ts +3 -3
- package/dist/server/timeback.d.ts +5 -3
- package/dist/server/timeback.d.ts.map +1 -1
- package/dist/server/types.d.ts +407 -14
- package/dist/server/types.d.ts.map +1 -1
- package/dist/shared/constants.d.ts +7 -0
- package/dist/shared/constants.d.ts.map +1 -1
- package/dist/shared/constants.ts +51 -0
- package/dist/shared/index.d.ts +9 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/schemas.d.ts +57 -0
- package/dist/shared/schemas.d.ts.map +1 -0
- package/dist/shared/types.d.ts +287 -18
- package/dist/shared/types.d.ts.map +1 -1
- package/dist/shared/types.ts +636 -0
- package/package.json +7 -10
- package/dist/chunk-07j8zre9.js +0 -2
- package/dist/chunk-5171mkp2.js +0 -2
- package/dist/chunk-63afdp3y.js +0 -8
- package/dist/chunk-8gg8n8v9.js +0 -2
- package/dist/chunk-9se82640.js +0 -1
- package/dist/chunk-agpf1x3g.js +0 -16
- package/dist/chunk-hnf0tart.js +0 -2
- package/dist/chunk-qr0bbnsr.js +0 -1
- package/dist/chunk-whc53e0y.js +0 -11
- package/dist/chunk-x9gvef7q.js +0 -1
- package/dist/edge.d.ts +0 -13
- package/dist/edge.d.ts.map +0 -1
- package/dist/edge.js +0 -1
- package/dist/server/handlers/activity/handler.d.ts +0 -32
- package/dist/server/handlers/activity/handler.d.ts.map +0 -1
- package/dist/shared/xp-calculator.d.ts +0 -25
- package/dist/shared/xp-calculator.d.ts.map +0 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Activity Record
|
|
3
|
+
*
|
|
4
|
+
* Server-side activity recording API implementation.
|
|
5
|
+
* Allows apps to submit activity completions directly from their backend.
|
|
6
|
+
*/
|
|
7
|
+
import { recordCompletion as recordCompletionImpl, sendTimeSpent as sendTimeSpentImpl } from '../../handlers/activity/submit';
|
|
8
|
+
import type { TimebackClient } from '@timeback/core';
|
|
9
|
+
import type { ActivityRecordInput, ApiCredentials, AppConfig, Environment, TimebackConfig } from '../../types';
|
|
10
|
+
/**
|
|
11
|
+
* Error thrown when activity record validation fails.
|
|
12
|
+
*/
|
|
13
|
+
export declare class ActivityRecordValidationError extends Error {
|
|
14
|
+
readonly code: "VALIDATION_ERROR";
|
|
15
|
+
readonly details: unknown;
|
|
16
|
+
constructor(message: string, details: unknown);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Error thrown when course resolution fails.
|
|
20
|
+
*/
|
|
21
|
+
export declare class ActivityRecordCourseError extends Error {
|
|
22
|
+
readonly code: "COURSE_ERROR";
|
|
23
|
+
constructor(message: string);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Configuration for creating the record function (internal).
|
|
27
|
+
*/
|
|
28
|
+
interface ActivityRecordConfig {
|
|
29
|
+
env: Environment;
|
|
30
|
+
api: ApiCredentials;
|
|
31
|
+
appConfig: AppConfig;
|
|
32
|
+
/** Get the shared Timeback API client. */
|
|
33
|
+
getClient: () => TimebackClient;
|
|
34
|
+
hooks?: TimebackConfig['hooks'];
|
|
35
|
+
}
|
|
36
|
+
interface ActivityRecordDeps {
|
|
37
|
+
recordCompletion: typeof recordCompletionImpl;
|
|
38
|
+
sendTimeSpent: typeof sendTimeSpentImpl;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Create the activity record function.
|
|
42
|
+
*
|
|
43
|
+
* @param config - Record configuration
|
|
44
|
+
* @param deps - Internal dependencies (for testing)
|
|
45
|
+
* @returns The record function
|
|
46
|
+
*/
|
|
47
|
+
export declare function createActivityRecord(config: ActivityRecordConfig, deps?: ActivityRecordDeps): (input: ActivityRecordInput) => Promise<void>;
|
|
48
|
+
export {};
|
|
49
|
+
//# sourceMappingURL=record.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../../../src/server/namespaces/activity/record.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,EACN,gBAAgB,IAAI,oBAAoB,EACxC,aAAa,IAAI,iBAAiB,EAClC,MAAM,gCAAgC,CAAA;AAKvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,KAAK,EACX,mBAAmB,EACnB,cAAc,EACd,SAAS,EACT,WAAW,EACX,cAAc,EACd,MAAM,aAAa,CAAA;AAQpB;;GAEG;AACH,qBAAa,6BAA8B,SAAQ,KAAK;IACvD,QAAQ,CAAC,IAAI,qBAA8B;IAC3C,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IAEzB,YAAY,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAI5C;CACD;AAED;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,KAAK;IACnD,QAAQ,CAAC,IAAI,iBAA0B;IAEvC,YAAY,OAAO,EAAE,MAAM,EAG1B;CACD;AAkJD;;GAEG;AACH,UAAU,oBAAoB;IAC7B,GAAG,EAAE,WAAW,CAAA;IAChB,GAAG,EAAE,cAAc,CAAA;IACnB,SAAS,EAAE,SAAS,CAAA;IACpB,0CAA0C;IAC1C,SAAS,EAAE,MAAM,cAAc,CAAA;IAC/B,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAA;CAC/B;AAED,UAAU,kBAAkB;IAC3B,gBAAgB,EAAE,OAAO,oBAAoB,CAAA;IAC7C,aAAa,EAAE,OAAO,iBAAiB,CAAA;CACvC;AAWD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CACnC,MAAM,EAAE,oBAAoB,EAC5B,IAAI,GAAE,kBAAgC,GACpC,CAAC,KAAK,EAAE,mBAAmB,KAAK,OAAO,CAAC,IAAI,CAAC,CAkE/C"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Activity Record Schema
|
|
3
|
+
*
|
|
4
|
+
* Zod schemas for validating `timeback.activity.record()` inputs.
|
|
5
|
+
*/
|
|
6
|
+
import * as z from 'zod';
|
|
7
|
+
export declare const runIdSchema: z.ZodOptional<z.ZodUUID>;
|
|
8
|
+
/** Schema for `timeback.activity.record()` input. */
|
|
9
|
+
export declare const activityRecordInputSchema: z.ZodObject<{
|
|
10
|
+
user: z.ZodObject<{
|
|
11
|
+
email: z.ZodEmail;
|
|
12
|
+
timebackId: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
activity: z.ZodObject<{
|
|
15
|
+
id: z.ZodString;
|
|
16
|
+
name: z.ZodString;
|
|
17
|
+
course: z.ZodUnion<readonly [z.ZodObject<{
|
|
18
|
+
subject: z.ZodEnum<{
|
|
19
|
+
FastMath: "FastMath";
|
|
20
|
+
Language: "Language";
|
|
21
|
+
Math: "Math";
|
|
22
|
+
None: "None";
|
|
23
|
+
Other: "Other";
|
|
24
|
+
Reading: "Reading";
|
|
25
|
+
Science: "Science";
|
|
26
|
+
"Social Studies": "Social Studies";
|
|
27
|
+
Vocabulary: "Vocabulary";
|
|
28
|
+
Writing: "Writing";
|
|
29
|
+
}>;
|
|
30
|
+
grade: z.ZodUnion<readonly [z.ZodLiteral<-1>, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<6>, z.ZodLiteral<7>, z.ZodLiteral<8>, z.ZodLiteral<9>, z.ZodLiteral<10>, z.ZodLiteral<11>, z.ZodLiteral<12>, z.ZodLiteral<13>]>;
|
|
31
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
32
|
+
code: z.ZodString;
|
|
33
|
+
}, z.core.$strip>]>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
metrics: z.ZodObject<{
|
|
36
|
+
totalQuestions: z.ZodOptional<z.ZodNumber>;
|
|
37
|
+
correctQuestions: z.ZodOptional<z.ZodNumber>;
|
|
38
|
+
xpEarned: z.ZodNumber;
|
|
39
|
+
masteredUnits: z.ZodOptional<z.ZodNumber>;
|
|
40
|
+
pctComplete: z.ZodOptional<z.ZodNumber>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
time: z.ZodOptional<z.ZodObject<{
|
|
43
|
+
startedAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodISODateTime, z.ZodDate]>>;
|
|
44
|
+
endedAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodISODateTime, z.ZodDate]>>;
|
|
45
|
+
activeMs: z.ZodOptional<z.ZodNumber>;
|
|
46
|
+
inactiveMs: z.ZodOptional<z.ZodNumber>;
|
|
47
|
+
}, z.core.$strip>>;
|
|
48
|
+
runId: z.ZodOptional<z.ZodUUID>;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/server/namespaces/activity/schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAkCxB,eAAO,MAAM,WAAW,0BAAsB,CAAA;AAM9C,qDAAqD;AACrD,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAMpC,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User Get Profile
|
|
3
|
+
*
|
|
4
|
+
* Server-side user profile API implementation.
|
|
5
|
+
* Programmatic equivalent of the `/user/me` HTTP handler.
|
|
6
|
+
*/
|
|
7
|
+
import type { TimebackProfile } from '../../../shared/types';
|
|
8
|
+
import type { TimebackClient } from '@timeback/core';
|
|
9
|
+
import type { ApiCredentials, AppConfig, Environment } from '../../types';
|
|
10
|
+
/**
|
|
11
|
+
* Configuration for creating the getProfile function (internal).
|
|
12
|
+
*/
|
|
13
|
+
interface UserGetProfileConfig {
|
|
14
|
+
env: Environment;
|
|
15
|
+
api: ApiCredentials;
|
|
16
|
+
appConfig: AppConfig;
|
|
17
|
+
/** Get the shared Timeback API client. */
|
|
18
|
+
getClient: () => TimebackClient;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Create the user getProfile function.
|
|
22
|
+
*
|
|
23
|
+
* Returns the full enriched `TimebackProfile` (identity, enrollments, courses,
|
|
24
|
+
* goals, XP) for a given email. This is the programmatic equivalent of the
|
|
25
|
+
* `/user/me` HTTP handler.
|
|
26
|
+
*
|
|
27
|
+
* @param config - GetProfile configuration
|
|
28
|
+
* @returns The getProfile function
|
|
29
|
+
*/
|
|
30
|
+
export declare function createUserGetProfile(config: UserGetProfileConfig): (email: string) => Promise<TimebackProfile>;
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=get-profile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-profile.d.ts","sourceRoot":"","sources":["../../../../src/server/namespaces/user/get-profile.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAUH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAQzE;;GAEG;AACH,UAAU,oBAAoB;IAC7B,GAAG,EAAE,WAAW,CAAA;IAChB,GAAG,EAAE,cAAc,CAAA;IACnB,SAAS,EAAE,SAAS,CAAA;IACpB,0CAA0C;IAC1C,SAAS,EAAE,MAAM,cAAc,CAAA;CAC/B;AAMD;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CACnC,MAAM,EAAE,oBAAoB,GAC1B,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,eAAe,CAAC,CA6B7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/server/namespaces/user/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User Verify
|
|
3
|
+
*
|
|
4
|
+
* Server-side user verification API implementation.
|
|
5
|
+
* Programmatic equivalent of the `/user/verify` HTTP handler.
|
|
6
|
+
*/
|
|
7
|
+
import type { TimebackClient } from '@timeback/core';
|
|
8
|
+
import type { TimebackVerifyResult } from '../../../shared/types';
|
|
9
|
+
/**
|
|
10
|
+
* Configuration for creating the verify function (internal).
|
|
11
|
+
*/
|
|
12
|
+
interface UserVerifyConfig {
|
|
13
|
+
/** Get the shared Timeback API client. */
|
|
14
|
+
getClient: () => TimebackClient;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Create the user verify function.
|
|
18
|
+
*
|
|
19
|
+
* Checks whether a Timeback user exists for the given email without
|
|
20
|
+
* building the full enriched profile. This is the programmatic equivalent
|
|
21
|
+
* of the `/user/verify` HTTP handler.
|
|
22
|
+
*
|
|
23
|
+
* @param config - Verify configuration
|
|
24
|
+
* @returns The verify function
|
|
25
|
+
*/
|
|
26
|
+
export declare function createUserVerify(config: UserVerifyConfig): (email: string) => Promise<TimebackVerifyResult>;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=verify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../../src/server/namespaces/user/verify.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAQjE;;GAEG;AACH,UAAU,gBAAgB;IACzB,0CAA0C;IAC1C,SAAS,EAAE,MAAM,cAAc,CAAA;CAC/B;AAMD;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC/B,MAAM,EAAE,gBAAgB,GACtB,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,oBAAoB,CAAC,CA6BlD"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Timeback Server SDK (Identity-only)
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Lightweight factory for SSO-only integrations without activity tracking.
|
|
5
|
+
* The entire SDK is now edge-compatible, but this factory avoids the `c12`
|
|
6
|
+
* config-loading overhead that `createTimeback()` requires.
|
|
7
7
|
*/
|
|
8
8
|
import type { IdentityOnlyConfig, IdentityOnlyInstance } from './types';
|
|
9
9
|
/**
|
|
@@ -7,7 +7,7 @@ import type { TimebackConfig, TimebackInstance } from './types';
|
|
|
7
7
|
/**
|
|
8
8
|
* Create a Timeback server instance.
|
|
9
9
|
*
|
|
10
|
-
* Returns
|
|
10
|
+
* Returns an instance with raw handlers.
|
|
11
11
|
*
|
|
12
12
|
* Use an adapter to integrate with your framework:
|
|
13
13
|
* - `toNextjsHandler()` for Next.js App Router
|
|
@@ -20,8 +20,9 @@ import type { TimebackConfig, TimebackInstance } from './types';
|
|
|
20
20
|
* @param config - Server configuration
|
|
21
21
|
* @returns Timeback instance with handlers
|
|
22
22
|
*
|
|
23
|
-
* @example
|
|
23
|
+
* @example
|
|
24
24
|
* ```typescript
|
|
25
|
+
* // SSO mode
|
|
25
26
|
* import { createTimeback } from '@timeback/sdk'
|
|
26
27
|
* import { toNextjsHandler } from '@timeback/sdk/nextjs'
|
|
27
28
|
*
|
|
@@ -49,8 +50,9 @@ import type { TimebackConfig, TimebackInstance } from './types';
|
|
|
49
50
|
* export const { GET, POST } = toNextjsHandler(timeback)
|
|
50
51
|
* ```
|
|
51
52
|
*
|
|
52
|
-
* @example
|
|
53
|
+
* @example
|
|
53
54
|
* ```typescript
|
|
55
|
+
* // Custom identity mode (bring your own auth)
|
|
54
56
|
* const timeback = await createTimeback({
|
|
55
57
|
* env: 'production',
|
|
56
58
|
* api: { ... },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeback.d.ts","sourceRoot":"","sources":["../../src/server/timeback.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"timeback.d.ts","sourceRoot":"","sources":["../../src/server/timeback.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAiBH,OAAO,KAAK,EAA0B,cAAc,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AA0CvF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AACH,wBAAsB,cAAc,CAAC,MAAM,GAAG,OAAO,EACpD,MAAM,EAAE,cAAc,CAAC,MAAM,CAAC,GAC5B,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAoHnC"}
|