timeback 0.1.3 → 0.1.4
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 +34 -559
- package/dist/cli/src/config.d.ts +8 -0
- package/dist/cli.js +111089 -0
- package/dist/types/src/config.d.ts +106 -0
- package/dist/types/src/index.d.ts +5 -0
- package/dist/types/src/primitives.d.ts +53 -0
- package/package.json +27 -91
- package/schema.json +222 -0
- package/dist/client/adapters/react/SignInButton.d.ts +0 -60
- package/dist/client/adapters/react/SignInButton.d.ts.map +0 -1
- package/dist/client/adapters/react/index.d.ts +0 -43
- package/dist/client/adapters/react/index.d.ts.map +0 -1
- package/dist/client/adapters/react/index.js +0 -478
- package/dist/client/adapters/react/provider.d.ts +0 -74
- package/dist/client/adapters/react/provider.d.ts.map +0 -1
- package/dist/client/adapters/solid/SignInButton.d.ts +0 -52
- package/dist/client/adapters/solid/SignInButton.d.ts.map +0 -1
- package/dist/client/adapters/solid/SignInButton.tsx +0 -321
- package/dist/client/adapters/solid/context.d.ts +0 -73
- package/dist/client/adapters/solid/context.d.ts.map +0 -1
- package/dist/client/adapters/solid/context.tsx +0 -91
- package/dist/client/adapters/solid/index.d.ts +0 -42
- package/dist/client/adapters/solid/index.d.ts.map +0 -1
- package/dist/client/adapters/solid/index.ts +0 -46
- package/dist/client/adapters/svelte/SignInButton.svelte +0 -234
- package/dist/client/adapters/svelte/SignInButton.svelte.d.ts +0 -24
- package/dist/client/adapters/svelte/index.d.ts +0 -33
- package/dist/client/adapters/svelte/index.d.ts.map +0 -1
- package/dist/client/adapters/svelte/index.ts +0 -38
- package/dist/client/adapters/svelte/stores.d.ts +0 -62
- package/dist/client/adapters/svelte/stores.d.ts.map +0 -1
- package/dist/client/adapters/svelte/stores.ts +0 -139
- package/dist/client/adapters/vue/SignInButton.vue +0 -260
- package/dist/client/adapters/vue/SignInButton.vue.d.ts +0 -53
- package/dist/client/adapters/vue/index.d.ts +0 -43
- package/dist/client/adapters/vue/index.d.ts.map +0 -1
- package/dist/client/adapters/vue/index.ts +0 -48
- package/dist/client/adapters/vue/provider.d.ts +0 -94
- package/dist/client/adapters/vue/provider.d.ts.map +0 -1
- package/dist/client/adapters/vue/provider.ts +0 -147
- package/dist/client/index.d.ts +0 -9
- package/dist/client/index.d.ts.map +0 -1
- package/dist/client/lib/activity/activity.class.d.ts +0 -73
- package/dist/client/lib/activity/activity.class.d.ts.map +0 -1
- package/dist/client/lib/activity/activity.d.ts +0 -16
- package/dist/client/lib/activity/activity.d.ts.map +0 -1
- package/dist/client/lib/activity/index.d.ts +0 -6
- package/dist/client/lib/activity/index.d.ts.map +0 -1
- package/dist/client/lib/utils.d.ts +0 -20
- package/dist/client/lib/utils.d.ts.map +0 -1
- package/dist/client/namespaces/activity.d.ts +0 -37
- package/dist/client/namespaces/activity.d.ts.map +0 -1
- package/dist/client/namespaces/auth.d.ts +0 -33
- package/dist/client/namespaces/auth.d.ts.map +0 -1
- package/dist/client/namespaces/index.d.ts +0 -7
- package/dist/client/namespaces/index.d.ts.map +0 -1
- package/dist/client/namespaces/user.d.ts +0 -29
- package/dist/client/namespaces/user.d.ts.map +0 -1
- package/dist/client/timeback-client.class.d.ts +0 -37
- package/dist/client/timeback-client.class.d.ts.map +0 -1
- package/dist/client/timeback-client.d.ts +0 -29
- package/dist/client/timeback-client.d.ts.map +0 -1
- package/dist/client.d.ts +0 -30
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -198
- package/dist/edge.d.ts +0 -13
- package/dist/edge.d.ts.map +0 -1
- package/dist/edge.js +0 -1149
- package/dist/identity.d.ts +0 -14
- package/dist/identity.d.ts.map +0 -1
- package/dist/identity.js +0 -1019
- package/dist/index.d.ts +0 -48
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -10221
- package/dist/server/adapters/express.d.ts +0 -66
- package/dist/server/adapters/express.d.ts.map +0 -1
- package/dist/server/adapters/express.js +0 -9326
- package/dist/server/adapters/native.d.ts +0 -47
- package/dist/server/adapters/native.d.ts.map +0 -1
- package/dist/server/adapters/native.js +0 -190
- package/dist/server/adapters/nextjs.d.ts +0 -32
- package/dist/server/adapters/nextjs.d.ts.map +0 -1
- package/dist/server/adapters/nextjs.js +0 -202
- package/dist/server/adapters/nuxt.d.ts +0 -98
- package/dist/server/adapters/nuxt.d.ts.map +0 -1
- package/dist/server/adapters/nuxt.js +0 -9395
- package/dist/server/adapters/solid-start.d.ts +0 -63
- package/dist/server/adapters/solid-start.d.ts.map +0 -1
- package/dist/server/adapters/solid-start.js +0 -9294
- package/dist/server/adapters/svelte-kit.d.ts +0 -84
- package/dist/server/adapters/svelte-kit.d.ts.map +0 -1
- package/dist/server/adapters/svelte-kit.js +0 -243
- package/dist/server/adapters/tanstack-start.d.ts +0 -42
- package/dist/server/adapters/tanstack-start.d.ts.map +0 -1
- package/dist/server/adapters/tanstack-start.js +0 -9272
- package/dist/server/adapters/types.d.ts +0 -294
- package/dist/server/adapters/types.d.ts.map +0 -1
- package/dist/server/adapters/utils.d.ts +0 -76
- package/dist/server/adapters/utils.d.ts.map +0 -1
- package/dist/server/handlers/activity.d.ts +0 -28
- package/dist/server/handlers/activity.d.ts.map +0 -1
- package/dist/server/handlers/identity-full.d.ts +0 -28
- package/dist/server/handlers/identity-full.d.ts.map +0 -1
- package/dist/server/handlers/identity-only.d.ts +0 -22
- package/dist/server/handlers/identity-only.d.ts.map +0 -1
- package/dist/server/handlers/index.d.ts +0 -9
- package/dist/server/handlers/index.d.ts.map +0 -1
- package/dist/server/handlers/user.d.ts +0 -30
- package/dist/server/handlers/user.d.ts.map +0 -1
- package/dist/server/index.d.ts +0 -9
- package/dist/server/index.d.ts.map +0 -1
- package/dist/server/lib/index.d.ts +0 -10
- package/dist/server/lib/index.d.ts.map +0 -1
- package/dist/server/lib/logger.d.ts +0 -21
- package/dist/server/lib/logger.d.ts.map +0 -1
- package/dist/server/lib/oidc.d.ts +0 -76
- package/dist/server/lib/oidc.d.ts.map +0 -1
- package/dist/server/lib/resolve-timeback-user.d.ts +0 -42
- package/dist/server/lib/resolve-timeback-user.d.ts.map +0 -1
- package/dist/server/lib/utils.d.ts +0 -54
- package/dist/server/lib/utils.d.ts.map +0 -1
- package/dist/server/timeback-identity.d.ts +0 -19
- package/dist/server/timeback-identity.d.ts.map +0 -1
- package/dist/server/timeback.d.ts +0 -68
- package/dist/server/timeback.d.ts.map +0 -1
- package/dist/server/types.d.ts +0 -402
- package/dist/server/types.d.ts.map +0 -1
- package/dist/shared/constants.d.ts +0 -18
- package/dist/shared/constants.d.ts.map +0 -1
- package/dist/shared/types.d.ts +0 -144
- package/dist/shared/types.d.ts.map +0 -1
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Timeback User Resolution
|
|
3
|
-
*
|
|
4
|
-
* Resolves the Timeback user by email using server credentials.
|
|
5
|
-
*/
|
|
6
|
-
import { TimebackClient } from '@timeback/core';
|
|
7
|
-
import type { TimebackAuthUser } from '../../shared/types';
|
|
8
|
-
import type { ApiCredentials, Environment, OIDCUserInfo, TimebackUserResolutionErrorCode } from '../types';
|
|
9
|
-
/**
|
|
10
|
-
* Error thrown when Timeback user resolution fails.
|
|
11
|
-
*/
|
|
12
|
-
export declare class TimebackUserResolutionError extends Error {
|
|
13
|
-
readonly code: TimebackUserResolutionErrorCode;
|
|
14
|
-
constructor(message: string, code: TimebackUserResolutionErrorCode);
|
|
15
|
-
}
|
|
16
|
-
interface ResolveTimebackUserByEmailParams {
|
|
17
|
-
/** Environment (staging/production) */
|
|
18
|
-
env: Environment;
|
|
19
|
-
/** API credentials for Timeback API */
|
|
20
|
-
apiCredentials: ApiCredentials;
|
|
21
|
-
/** OIDC user info from the IdP */
|
|
22
|
-
userInfo: OIDCUserInfo;
|
|
23
|
-
/**
|
|
24
|
-
* Optional pre-configured Timeback client to use (e.g. `timeback.api`).
|
|
25
|
-
*
|
|
26
|
-
* When provided, this function will use it and will NOT close it.
|
|
27
|
-
*/
|
|
28
|
-
client?: TimebackClient;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Resolve a TimebackAuthUser by looking up the Timeback user via email.
|
|
32
|
-
*
|
|
33
|
-
* Uses server API credentials to query OneRoster for a user matching the IdP email.
|
|
34
|
-
* Strict mode: fails if no user found or if multiple users match (ambiguous).
|
|
35
|
-
*
|
|
36
|
-
* @param params - Resolution parameters
|
|
37
|
-
* @returns Resolved TimebackAuthUser with Timeback profile and IdP claims
|
|
38
|
-
* @throws {TimebackUserResolutionError} If resolution fails
|
|
39
|
-
*/
|
|
40
|
-
export declare function resolveTimebackUserByEmail(params: ResolveTimebackUserByEmailParams): Promise<TimebackAuthUser>;
|
|
41
|
-
export {};
|
|
42
|
-
//# sourceMappingURL=resolve-timeback-user.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-timeback-user.d.ts","sourceRoot":"","sources":["../../../src/server/lib/resolve-timeback-user.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAM/C,OAAO,KAAK,EAAkB,gBAAgB,EAAmB,MAAM,oBAAoB,CAAA;AAC3F,OAAO,KAAK,EACX,cAAc,EACd,WAAW,EACX,YAAY,EACZ,+BAA+B,EAC/B,MAAM,UAAU,CAAA;AAIjB;;GAEG;AACH,qBAAa,2BAA4B,SAAQ,KAAK;aAGpC,IAAI,EAAE,+BAA+B;IAFtD,YACC,OAAO,EAAE,MAAM,EACC,IAAI,EAAE,+BAA+B,EAIrD;CACD;AAED,UAAU,gCAAgC;IACzC,uCAAuC;IACvC,GAAG,EAAE,WAAW,CAAA;IAChB,uCAAuC;IACvC,cAAc,EAAE,cAAc,CAAA;IAC9B,kCAAkC;IAClC,QAAQ,EAAE,YAAY,CAAA;IACtB;;;;OAIG;IACH,MAAM,CAAC,EAAE,cAAc,CAAA;CACvB;AAkBD;;;;;;;;;GASG;AACH,wBAAsB,0BAA0B,CAC/C,MAAM,EAAE,gCAAgC,GACtC,OAAO,CAAC,gBAAgB,CAAC,CAiG3B"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Server Utilities
|
|
3
|
-
*
|
|
4
|
-
* Internal utility functions for the server SDK.
|
|
5
|
-
*/
|
|
6
|
-
import type { Environment } from '../types';
|
|
7
|
-
/**
|
|
8
|
-
* Map SDK environment to the environment used for outbound Timeback API calls.
|
|
9
|
-
*
|
|
10
|
-
* The SDK's `env` config controls runtime mode, but for outbound service calls
|
|
11
|
-
* (OneRoster, Caliper, etc.) we need a real Timeback environment:
|
|
12
|
-
*
|
|
13
|
-
* - `local` → `staging` (local dev uses staging services)
|
|
14
|
-
* - `staging` → `staging`
|
|
15
|
-
* - `production` → `production`
|
|
16
|
-
*
|
|
17
|
-
* @param env - SDK environment setting
|
|
18
|
-
* @returns Environment to use for TimebackClient
|
|
19
|
-
*/
|
|
20
|
-
export declare function mapEnvForApi(env: Environment): 'staging' | 'production';
|
|
21
|
-
/**
|
|
22
|
-
* Create a JSON response.
|
|
23
|
-
*
|
|
24
|
-
* @param data - Response data
|
|
25
|
-
* @param status - HTTP status code
|
|
26
|
-
* @param headers - Additional headers
|
|
27
|
-
* @returns JSON response
|
|
28
|
-
*/
|
|
29
|
-
export declare function jsonResponse<T>(data: T, status?: number, headers?: HeadersInit): Response;
|
|
30
|
-
/**
|
|
31
|
-
* Create a redirect response.
|
|
32
|
-
*
|
|
33
|
-
* @param url - URL to redirect to
|
|
34
|
-
* @param headers - Additional headers (e.g., Set-Cookie)
|
|
35
|
-
* @returns Redirect response
|
|
36
|
-
*/
|
|
37
|
-
export declare function redirectResponse(url: string, headers?: HeadersInit): Response;
|
|
38
|
-
/**
|
|
39
|
-
* Encode an object to a base64url-safe string.
|
|
40
|
-
*
|
|
41
|
-
* Used for OIDC state parameter.
|
|
42
|
-
*
|
|
43
|
-
* @param data - Data to encode
|
|
44
|
-
* @returns Base64url encoded string
|
|
45
|
-
*/
|
|
46
|
-
export declare function encodeBase64Url(data: unknown): string;
|
|
47
|
-
/**
|
|
48
|
-
* Decode a base64url string back to an object.
|
|
49
|
-
*
|
|
50
|
-
* @param encoded - Base64url encoded string
|
|
51
|
-
* @returns Decoded object
|
|
52
|
-
*/
|
|
53
|
-
export declare function decodeBase64Url<T>(encoded: string): T;
|
|
54
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/server/lib/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAE3C;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,WAAW,GAAG,SAAS,GAAG,YAAY,CAMvE;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,SAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,QAAQ,CAItF;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,QAAQ,CAI7E;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAIrD;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC,CAKrD"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Timeback Server SDK (Identity-only)
|
|
3
|
-
*
|
|
4
|
-
* This file is intentionally Node-free so it can be used in edge runtimes
|
|
5
|
-
* (e.g. Cloudflare Workers / workerd) without pulling in Node-only deps
|
|
6
|
-
* like `jiti`, `fs`, etc.
|
|
7
|
-
*/
|
|
8
|
-
import type { IdentityOnlyConfig, IdentityOnlyInstance } from './types';
|
|
9
|
-
/**
|
|
10
|
-
* Create an identity-only Timeback server instance.
|
|
11
|
-
*
|
|
12
|
-
* Use this when you only need SSO authentication without activity tracking
|
|
13
|
-
* or Timeback API integration. Does not require `timeback.config.ts`.
|
|
14
|
-
*
|
|
15
|
-
* @param config - Identity-only configuration
|
|
16
|
-
* @returns Identity-only Timeback server instance
|
|
17
|
-
*/
|
|
18
|
-
export declare function createTimebackIdentity<TState = unknown>(config: IdentityOnlyConfig<TState>): IdentityOnlyInstance<TState>;
|
|
19
|
-
//# sourceMappingURL=timeback-identity.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"timeback-identity.d.ts","sourceRoot":"","sources":["../../src/server/timeback-identity.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAEvE;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,GAAG,OAAO,EACtD,MAAM,EAAE,kBAAkB,CAAC,MAAM,CAAC,GAChC,oBAAoB,CAAC,MAAM,CAAC,CAY9B"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Timeback Server SDK
|
|
3
|
-
*
|
|
4
|
-
* Factory functions to create Timeback server instances.
|
|
5
|
-
*/
|
|
6
|
-
import type { TimebackConfig, TimebackInstance } from './types';
|
|
7
|
-
/**
|
|
8
|
-
* Create a Timeback server instance.
|
|
9
|
-
*
|
|
10
|
-
* Returns a framework-agnostic instance with raw handlers.
|
|
11
|
-
*
|
|
12
|
-
* Use an adapter to integrate with your framework:
|
|
13
|
-
* - `toNextjsHandler()` for Next.js App Router
|
|
14
|
-
* - `toHonoApp()` / `toHonoMiddleware()` for Hono
|
|
15
|
-
* - `toExpressMiddleware()` / `mountExpressRoutes()` for Express
|
|
16
|
-
*
|
|
17
|
-
* When using SSO mode, the callback receives an enriched `TimebackAuthUser` with
|
|
18
|
-
* `user.id` being the canonical Timeback user ID (timebackId).
|
|
19
|
-
*
|
|
20
|
-
* @param config - Server configuration
|
|
21
|
-
* @returns Timeback instance with handlers
|
|
22
|
-
*
|
|
23
|
-
* @example SSO mode
|
|
24
|
-
* ```typescript
|
|
25
|
-
* import { createTimeback } from 'timeback'
|
|
26
|
-
* import { toNextjsHandler } from 'timeback/nextjs'
|
|
27
|
-
*
|
|
28
|
-
* const timeback = await createTimeback({
|
|
29
|
-
* env: 'production',
|
|
30
|
-
* api: {
|
|
31
|
-
* clientId: process.env.TIMEBACK_API_CLIENT_ID!,
|
|
32
|
-
* clientSecret: process.env.TIMEBACK_API_CLIENT_SECRET!,
|
|
33
|
-
* },
|
|
34
|
-
* identity: {
|
|
35
|
-
* mode: 'sso',
|
|
36
|
-
* clientId: process.env.AWS_COGNITO_CLIENT_ID!,
|
|
37
|
-
* clientSecret: process.env.AWS_COGNITO_CLIENT_SECRET!,
|
|
38
|
-
* onCallbackSuccess: async ({ user, state, redirect }) => {
|
|
39
|
-
* // user.id is the timebackId (canonical stable identifier)
|
|
40
|
-
* await setSession({ id: user.id, email: user.email })
|
|
41
|
-
* return redirect(state.returnTo ?? '/')
|
|
42
|
-
* },
|
|
43
|
-
* onCallbackError: ({ error, redirect }) => redirect('/?error=sso_failed'),
|
|
44
|
-
* getUser: (req) => getSessionUser(req),
|
|
45
|
-
* },
|
|
46
|
-
* })
|
|
47
|
-
*
|
|
48
|
-
* // For Next.js App Router
|
|
49
|
-
* export const { GET, POST } = toNextjsHandler(timeback)
|
|
50
|
-
* ```
|
|
51
|
-
*
|
|
52
|
-
* @example Custom identity mode (bring your own auth)
|
|
53
|
-
* ```typescript
|
|
54
|
-
* const timeback = await createTimeback({
|
|
55
|
-
* env: 'production',
|
|
56
|
-
* api: { ... },
|
|
57
|
-
* identity: {
|
|
58
|
-
* mode: 'custom',
|
|
59
|
-
* getUser: async (req) => {
|
|
60
|
-
* const session = await getSession(req)
|
|
61
|
-
* return session ? { id: session.userId, email: session.email } : undefined
|
|
62
|
-
* },
|
|
63
|
-
* },
|
|
64
|
-
* })
|
|
65
|
-
* ```
|
|
66
|
-
*/
|
|
67
|
-
export declare function createTimeback<TState = unknown>(config: TimebackConfig<TState>): Promise<TimebackInstance<TState>>;
|
|
68
|
-
//# sourceMappingURL=timeback.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"timeback.d.ts","sourceRoot":"","sources":["../../src/server/timeback.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,wBAAsB,cAAc,CAAC,MAAM,GAAG,OAAO,EACpD,MAAM,EAAE,cAAc,CAAC,MAAM,CAAC,GAC5B,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAgEnC"}
|
package/dist/server/types.d.ts
DELETED
|
@@ -1,402 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Server Types
|
|
3
|
-
*
|
|
4
|
-
* Configuration and internal types for the server SDK.
|
|
5
|
-
*/
|
|
6
|
-
import type { TimebackClient } from '@timeback/core';
|
|
7
|
-
import type { TimebackAuthUser, TimebackIdentity } from '../shared/types';
|
|
8
|
-
/**
|
|
9
|
-
* Environment configuration.
|
|
10
|
-
*/
|
|
11
|
-
export type Environment = 'local' | 'staging' | 'production';
|
|
12
|
-
/**
|
|
13
|
-
* Error codes for Timeback user resolution failures.
|
|
14
|
-
*/
|
|
15
|
-
export type TimebackUserResolutionErrorCode = 'missing_email' | 'timeback_user_not_found' | 'timeback_user_ambiguous' | 'timeback_user_lookup_failed';
|
|
16
|
-
/**
|
|
17
|
-
* API credentials for Timeback API calls.
|
|
18
|
-
*/
|
|
19
|
-
export interface ApiCredentials {
|
|
20
|
-
clientId: string;
|
|
21
|
-
clientSecret: string;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* OIDC tokens returned from the identity provider.
|
|
25
|
-
*/
|
|
26
|
-
export interface OIDCTokens {
|
|
27
|
-
/** Access token for API calls */
|
|
28
|
-
access_token: string;
|
|
29
|
-
/** ID token containing user claims */
|
|
30
|
-
id_token?: string;
|
|
31
|
-
/** Refresh token for obtaining new access tokens */
|
|
32
|
-
refresh_token?: string;
|
|
33
|
-
/** Token type (usually "Bearer") */
|
|
34
|
-
token_type: string;
|
|
35
|
-
/** Token expiration in seconds */
|
|
36
|
-
expires_in?: number;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Identity provider link info (e.g., Google, Facebook).
|
|
40
|
-
*/
|
|
41
|
-
export interface IdentityProviderLink {
|
|
42
|
-
/** When the identity was linked */
|
|
43
|
-
dateCreated: string;
|
|
44
|
-
/** User ID from the external provider */
|
|
45
|
-
userId: string;
|
|
46
|
-
/** Provider name (e.g., "Google", "Facebook") */
|
|
47
|
-
providerName: string;
|
|
48
|
-
/** Provider type */
|
|
49
|
-
providerType: string;
|
|
50
|
-
/** Issuer URL (if applicable) */
|
|
51
|
-
issuer: string | null;
|
|
52
|
-
/** Whether this is the primary identity */
|
|
53
|
-
primary: string;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* User info claims from the identity provider.
|
|
57
|
-
*/
|
|
58
|
-
export interface OIDCUserInfo {
|
|
59
|
-
/** Subject identifier (unique user ID from IdP) */
|
|
60
|
-
sub: string;
|
|
61
|
-
/** User's email address */
|
|
62
|
-
email?: string;
|
|
63
|
-
/** Whether email is verified */
|
|
64
|
-
email_verified?: boolean | string;
|
|
65
|
-
/** User's full name */
|
|
66
|
-
name?: string;
|
|
67
|
-
/** User's given/first name */
|
|
68
|
-
given_name?: string;
|
|
69
|
-
/** User's family/last name */
|
|
70
|
-
family_name?: string;
|
|
71
|
-
/** User's profile picture URL */
|
|
72
|
-
picture?: string;
|
|
73
|
-
/** Username in the IdP */
|
|
74
|
-
username?: string;
|
|
75
|
-
/** Linked identity providers (JSON string from Cognito) */
|
|
76
|
-
identities?: string | IdentityProviderLink[];
|
|
77
|
-
/** Additional claims */
|
|
78
|
-
[key: string]: unknown;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Context passed to buildState hook.
|
|
82
|
-
*/
|
|
83
|
-
export interface BuildStateContext {
|
|
84
|
-
/** The incoming sign-in request */
|
|
85
|
-
req: Request;
|
|
86
|
-
/** Parsed URL for easy access to query params */
|
|
87
|
-
url: URL;
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Raw identity provider data (tokens and user info claims).
|
|
91
|
-
*/
|
|
92
|
-
export interface IdpData {
|
|
93
|
-
/** OIDC tokens from the identity provider */
|
|
94
|
-
tokens: OIDCTokens;
|
|
95
|
-
/** User info claims from the identity provider */
|
|
96
|
-
userInfo: OIDCUserInfo;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Context passed to onCallbackSuccess hook for full SDK (createTimeback).
|
|
100
|
-
*
|
|
101
|
-
* When using `createTimeback()` with SSO mode, the `user` field contains the
|
|
102
|
-
* enriched `TimebackAuthUser` with `timebackId` as the canonical identifier. Raw IdP
|
|
103
|
-
* data is available under `idp`.
|
|
104
|
-
*/
|
|
105
|
-
export interface CallbackSuccessContext<TState = unknown> {
|
|
106
|
-
/** Authenticated user with Timeback profile and IdP claims */
|
|
107
|
-
user: TimebackAuthUser;
|
|
108
|
-
/** Raw identity provider data (tokens and user info) */
|
|
109
|
-
idp: IdpData;
|
|
110
|
-
/** State data from buildState (if provided) */
|
|
111
|
-
state: TState | undefined;
|
|
112
|
-
/** The incoming callback request */
|
|
113
|
-
req: Request;
|
|
114
|
-
/** Helper to create a redirect response */
|
|
115
|
-
redirect: (url: string, headers?: HeadersInit) => Response;
|
|
116
|
-
/** Helper to create a JSON response */
|
|
117
|
-
json: <T>(data: T, status?: number, headers?: HeadersInit) => Response;
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Context passed to onCallbackSuccess hook for identity-only SDK (createTimebackIdentity).
|
|
121
|
-
*
|
|
122
|
-
* When using `createTimebackIdentity()`, the `user` field contains raw OIDC user info
|
|
123
|
-
* claims (no Timeback profile enrichment).
|
|
124
|
-
*/
|
|
125
|
-
export interface IdentityOnlyCallbackSuccessContext<TState = unknown> {
|
|
126
|
-
/** OIDC tokens from the identity provider */
|
|
127
|
-
tokens: OIDCTokens;
|
|
128
|
-
/** User info claims from the identity provider */
|
|
129
|
-
user: OIDCUserInfo;
|
|
130
|
-
/** State data from buildState (if provided) */
|
|
131
|
-
state: TState | undefined;
|
|
132
|
-
/** The incoming callback request */
|
|
133
|
-
req: Request;
|
|
134
|
-
/** Helper to create a redirect response */
|
|
135
|
-
redirect: (url: string, headers?: HeadersInit) => Response;
|
|
136
|
-
/** Helper to create a JSON response */
|
|
137
|
-
json: <T>(data: T, status?: number, headers?: HeadersInit) => Response;
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Context passed to onCallbackError hook.
|
|
141
|
-
*/
|
|
142
|
-
export interface CallbackErrorContext<TState = unknown> {
|
|
143
|
-
/** The error that occurred */
|
|
144
|
-
error: Error;
|
|
145
|
-
/** Error code from OIDC provider (if available) */
|
|
146
|
-
errorCode?: string;
|
|
147
|
-
/** State data from buildState (if available) */
|
|
148
|
-
state: TState | undefined;
|
|
149
|
-
/** The incoming callback request */
|
|
150
|
-
req: Request;
|
|
151
|
-
/** Helper to create a redirect response */
|
|
152
|
-
redirect: (url: string, headers?: HeadersInit) => Response;
|
|
153
|
-
/** Helper to create a JSON response */
|
|
154
|
-
json: <T>(data: T, status?: number, headers?: HeadersInit) => Response;
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Base SSO identity configuration fields (shared between full and identity-only).
|
|
158
|
-
*/
|
|
159
|
-
interface BaseSsoIdentityConfig<TState = unknown> {
|
|
160
|
-
mode: 'sso';
|
|
161
|
-
/** OIDC client ID */
|
|
162
|
-
clientId: string;
|
|
163
|
-
/** OIDC client secret */
|
|
164
|
-
clientSecret: string;
|
|
165
|
-
/**
|
|
166
|
-
* Custom OIDC issuer URL.
|
|
167
|
-
*
|
|
168
|
-
* Override the default Timeback IdP URL. Useful for:
|
|
169
|
-
* - Local development with a mock OIDC server
|
|
170
|
-
* - Self-hosted Timeback instances
|
|
171
|
-
*
|
|
172
|
-
* @example 'http://localhost:3001/mock-oidc'
|
|
173
|
-
*/
|
|
174
|
-
issuer?: string;
|
|
175
|
-
/**
|
|
176
|
-
* Custom OAuth redirect URI.
|
|
177
|
-
*
|
|
178
|
-
* Override the auto-computed callback URL. Use when your IdP has
|
|
179
|
-
* pre-configured callback URLs that differ from the SDK default.
|
|
180
|
-
*
|
|
181
|
-
* @example 'http://localhost:5174/api/auth/sso/callback/timeback'
|
|
182
|
-
*/
|
|
183
|
-
redirectUri?: string;
|
|
184
|
-
/**
|
|
185
|
-
* Build custom state to pass through the OIDC flow.
|
|
186
|
-
*
|
|
187
|
-
* Use this to preserve data across the redirect (e.g., return URL, invite codes).
|
|
188
|
-
* State is encoded in the OIDC state parameter and returned in onCallbackSuccess.
|
|
189
|
-
*
|
|
190
|
-
* @param ctx - Context with request and parsed URL
|
|
191
|
-
* @returns State object (will be JSON serialized)
|
|
192
|
-
*
|
|
193
|
-
* @example
|
|
194
|
-
* ```typescript
|
|
195
|
-
* buildState: ({ url }) => ({
|
|
196
|
-
* returnTo: url.searchParams.get('returnTo') ?? '/dashboard',
|
|
197
|
-
* inviteId: url.searchParams.get('inviteId'),
|
|
198
|
-
* })
|
|
199
|
-
* ```
|
|
200
|
-
*/
|
|
201
|
-
buildState?: (ctx: BuildStateContext) => TState;
|
|
202
|
-
/**
|
|
203
|
-
* Called when OIDC authentication fails.
|
|
204
|
-
*
|
|
205
|
-
* @param ctx - Context with error info and helpers
|
|
206
|
-
* @returns Response (typically a redirect to an error page)
|
|
207
|
-
*
|
|
208
|
-
* @example
|
|
209
|
-
* ```typescript
|
|
210
|
-
* onCallbackError: ({ error, redirect }) => {
|
|
211
|
-
* console.error('SSO failed:', error)
|
|
212
|
-
* return redirect('/login?error=sso_failed')
|
|
213
|
-
* }
|
|
214
|
-
* ```
|
|
215
|
-
*/
|
|
216
|
-
onCallbackError?(ctx: CallbackErrorContext<TState>): Promise<Response> | Response;
|
|
217
|
-
/**
|
|
218
|
-
* Get the current user from the request.
|
|
219
|
-
*
|
|
220
|
-
* This is called by the activity handler to associate activities with users.
|
|
221
|
-
* Read your session cookie/JWT and return the user, or undefined if not authenticated.
|
|
222
|
-
*
|
|
223
|
-
* @param req - The incoming request
|
|
224
|
-
* @returns User object or undefined
|
|
225
|
-
*
|
|
226
|
-
* @example
|
|
227
|
-
* ```typescript
|
|
228
|
-
* // Async (with database/session lookup)
|
|
229
|
-
* getUser: async (req) => {
|
|
230
|
-
* const session = await getSession(req)
|
|
231
|
-
* if (!session) return undefined
|
|
232
|
-
* return { id: session.userId, email: session.email }
|
|
233
|
-
* }
|
|
234
|
-
*
|
|
235
|
-
* // Sync (already have user in memory)
|
|
236
|
-
* getUser: (req) => currentUser
|
|
237
|
-
* ```
|
|
238
|
-
*/
|
|
239
|
-
getUser(req: Request): Promise<TimebackIdentity | undefined> | TimebackIdentity | undefined;
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* SSO identity configuration for full SDK (createTimeback).
|
|
243
|
-
*
|
|
244
|
-
* When using `createTimeback()`, the SSO callback provides an enriched `TimebackAuthUser`
|
|
245
|
-
* with `timebackId` as the canonical identifier. The SDK resolves the Timeback
|
|
246
|
-
* user by email using server API credentials.
|
|
247
|
-
*/
|
|
248
|
-
export interface SsoIdentityConfig<TState = unknown, TSuccessContext = CallbackSuccessContext<TState>> extends BaseSsoIdentityConfig<TState> {
|
|
249
|
-
/**
|
|
250
|
-
* Called after successful OIDC authentication and Timeback user resolution.
|
|
251
|
-
*
|
|
252
|
-
* The `user` field contains the enriched `TimebackAuthUser` with:
|
|
253
|
-
* - `id`: Timeback user ID (canonical stable identifier)
|
|
254
|
-
* - `email`, `name`: User profile data
|
|
255
|
-
* - `claims`: Raw IdP claims (sub, firstName, lastName, pictureUrl)
|
|
256
|
-
*
|
|
257
|
-
* Raw IdP data (tokens, userInfo) is available under `idp`.
|
|
258
|
-
*
|
|
259
|
-
* @param ctx - Context with enriched user, IdP data, state, and helpers
|
|
260
|
-
* @returns Response (typically a redirect)
|
|
261
|
-
*
|
|
262
|
-
* @example
|
|
263
|
-
* ```typescript
|
|
264
|
-
* onCallbackSuccess: async ({ user, state, redirect }) => {
|
|
265
|
-
* // user.id is the timebackId (canonical identifier)
|
|
266
|
-
* await setSession({ id: user.id, email: user.email })
|
|
267
|
-
* return redirect(state.returnTo ?? '/')
|
|
268
|
-
* }
|
|
269
|
-
* ```
|
|
270
|
-
*/
|
|
271
|
-
onCallbackSuccess(ctx: TSuccessContext): Promise<Response> | Response;
|
|
272
|
-
}
|
|
273
|
-
/**
|
|
274
|
-
* Custom identity configuration.
|
|
275
|
-
*
|
|
276
|
-
* Use when you have your own auth system (Clerk, Auth0, etc.).
|
|
277
|
-
*/
|
|
278
|
-
export interface CustomIdentityConfig {
|
|
279
|
-
mode: 'custom';
|
|
280
|
-
/**
|
|
281
|
-
* Get the current user from the request.
|
|
282
|
-
*
|
|
283
|
-
* Read your session cookie/JWT and return the user, or undefined if not authenticated.
|
|
284
|
-
* Can return synchronously or as a Promise.
|
|
285
|
-
*
|
|
286
|
-
* @param req - The incoming request
|
|
287
|
-
* @returns User object or undefined (sync or async)
|
|
288
|
-
*/
|
|
289
|
-
getUser(req: Request): Promise<TimebackIdentity | undefined> | TimebackIdentity | undefined;
|
|
290
|
-
}
|
|
291
|
-
/**
|
|
292
|
-
* Identity configuration (SSO or custom).
|
|
293
|
-
*/
|
|
294
|
-
export type IdentityConfig<TState = unknown> = SsoIdentityConfig<TState> | CustomIdentityConfig;
|
|
295
|
-
/**
|
|
296
|
-
* Full Timeback SDK configuration.
|
|
297
|
-
*/
|
|
298
|
-
export interface TimebackConfig<TState = unknown> {
|
|
299
|
-
/** Optional path to timeback.config.ts (auto-discovered if not provided) */
|
|
300
|
-
configPath?: string;
|
|
301
|
-
/** Environment */
|
|
302
|
-
env: Environment;
|
|
303
|
-
/** API credentials for Timeback API */
|
|
304
|
-
api: ApiCredentials;
|
|
305
|
-
/** Identity configuration */
|
|
306
|
-
identity: IdentityConfig<TState>;
|
|
307
|
-
}
|
|
308
|
-
/**
|
|
309
|
-
* Request handlers namespace.
|
|
310
|
-
*/
|
|
311
|
-
export interface Handlers {
|
|
312
|
-
/** Activity submission handler */
|
|
313
|
-
activity: (req: Request) => Promise<Response>;
|
|
314
|
-
/** Identity-related handlers */
|
|
315
|
-
identity: {
|
|
316
|
-
/** Initiate sign-in (SSO only) */
|
|
317
|
-
signIn: (req: Request) => Promise<Response>;
|
|
318
|
-
/** Handle OAuth callback (SSO only) */
|
|
319
|
-
callback: (req: Request) => Promise<Response>;
|
|
320
|
-
/** Sign out user */
|
|
321
|
-
signOut: () => Response;
|
|
322
|
-
};
|
|
323
|
-
/** User profile handler */
|
|
324
|
-
user: {
|
|
325
|
-
/** Get current user profile */
|
|
326
|
-
me: (req: Request) => Promise<Response>;
|
|
327
|
-
};
|
|
328
|
-
}
|
|
329
|
-
/**
|
|
330
|
-
* App configuration from timeback.config.ts.
|
|
331
|
-
*/
|
|
332
|
-
export interface AppConfig {
|
|
333
|
-
name: string;
|
|
334
|
-
sensors: string[];
|
|
335
|
-
}
|
|
336
|
-
/**
|
|
337
|
-
* Timeback SDK instance (framework-agnostic).
|
|
338
|
-
*/
|
|
339
|
-
export interface TimebackInstance<TState = unknown> {
|
|
340
|
-
/** Configuration */
|
|
341
|
-
config: TimebackConfig<TState>;
|
|
342
|
-
/** Request handlers */
|
|
343
|
-
handle: Handlers;
|
|
344
|
-
/**
|
|
345
|
-
* Direct access to the Timeback API client.
|
|
346
|
-
*
|
|
347
|
-
* This is an escape hatch for advanced use cases that need to call Timeback
|
|
348
|
-
* services (OneRoster, Edubridge, Caliper, QTI) beyond what the SDK handlers
|
|
349
|
-
* provide. The client is created lazily on first access.
|
|
350
|
-
*
|
|
351
|
-
* Note: For `env: 'local'`, outbound API calls use `staging` environment.
|
|
352
|
-
*
|
|
353
|
-
* @example
|
|
354
|
-
* ```typescript
|
|
355
|
-
* // List users from OneRoster
|
|
356
|
-
* const { data: users } = await timeback.api.oneroster.users.list({ limit: 10 })
|
|
357
|
-
*
|
|
358
|
-
* // Send a Caliper event
|
|
359
|
-
* await timeback.api.caliper.emit(event)
|
|
360
|
-
* ```
|
|
361
|
-
*/
|
|
362
|
-
api: TimebackClient;
|
|
363
|
-
}
|
|
364
|
-
/**
|
|
365
|
-
* Identity-only configuration.
|
|
366
|
-
*
|
|
367
|
-
* Use this when you only need SSO authentication without activity tracking
|
|
368
|
-
* or Timeback API integration.
|
|
369
|
-
*/
|
|
370
|
-
export interface IdentityOnlyConfig<TState = unknown> {
|
|
371
|
-
/** Environment */
|
|
372
|
-
env: Environment;
|
|
373
|
-
/** Identity configuration (SSO mode required for identity-only) */
|
|
374
|
-
identity: SsoIdentityConfig<TState, IdentityOnlyCallbackSuccessContext<TState>>;
|
|
375
|
-
}
|
|
376
|
-
/**
|
|
377
|
-
* Identity-only handlers.
|
|
378
|
-
*/
|
|
379
|
-
export interface IdentityOnlyHandlers {
|
|
380
|
-
/** Identity-related handlers */
|
|
381
|
-
identity: {
|
|
382
|
-
/** Initiate sign-in */
|
|
383
|
-
signIn: (req: Request) => Promise<Response>;
|
|
384
|
-
/** Handle OAuth callback */
|
|
385
|
-
callback: (req: Request) => Promise<Response>;
|
|
386
|
-
/** Sign out user */
|
|
387
|
-
signOut: () => Response;
|
|
388
|
-
};
|
|
389
|
-
}
|
|
390
|
-
/**
|
|
391
|
-
* Identity-only SDK instance.
|
|
392
|
-
*
|
|
393
|
-
* Returned by `createTimebackIdentity()` for SSO-only integrations.
|
|
394
|
-
*/
|
|
395
|
-
export interface IdentityOnlyInstance<TState = unknown> {
|
|
396
|
-
/** Configuration */
|
|
397
|
-
config: IdentityOnlyConfig<TState>;
|
|
398
|
-
/** Request handlers (identity only) */
|
|
399
|
-
handle: IdentityOnlyHandlers;
|
|
400
|
-
}
|
|
401
|
-
export {};
|
|
402
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/server/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAEzE;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,SAAS,GAAG,YAAY,CAAA;AAE5D;;GAEG;AACH,MAAM,MAAM,+BAA+B,GACxC,eAAe,GACf,yBAAyB,GACzB,yBAAyB,GACzB,6BAA6B,CAAA;AAEhC;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,QAAQ,EAAE,MAAM,CAAA;IAChB,YAAY,EAAE,MAAM,CAAA;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B,iCAAiC;IACjC,YAAY,EAAE,MAAM,CAAA;IACpB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,oDAAoD;IACpD,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,oCAAoC;IACpC,UAAU,EAAE,MAAM,CAAA;IAClB,kCAAkC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC,mCAAmC;IACnC,WAAW,EAAE,MAAM,CAAA;IACnB,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAA;IACd,iDAAiD;IACjD,YAAY,EAAE,MAAM,CAAA;IACpB,oBAAoB;IACpB,YAAY,EAAE,MAAM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Q,CAAA;IAChB;;;;;;;;;;;;;;;;;OAiBG;IACH,GAAG,EAAE,cAAc,CAAA;CACnB;AAMD;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB,CAAC,MAAM,GAAG,OAAO;IACnD,kBAAkB;IAClB,GAAG,EAAE,WAAW,CAAA;IAChB,mEAAmE;IACnE,QAAQ,EAAE,iBAAiB,CAAC,MAAM,EAAE,kCAAkC,CAAC,MAAM,CAAC,CAAC,CAAA;CAC/E;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC,gCAAgC;IAChC,QAAQ,EAAE;QACT,uBAAuB;QACvB,MAAM,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;QAC3C,4BAA4B;QAC5B,QAAQ,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;QAC7C,oBAAoB;QACpB,OAAO,EAAE,MAAM,QAAQ,CAAA;KACvB,CAAA;CACD;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB,CAAC,MAAM,GAAG,OAAO;IACrD,oBAAoB;IACpB,MAAM,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAA;IAClC,uCAAuC;IACvC,MAAM,EAAE,oBAAoB,CAAA;CAC5B"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared Constants
|
|
3
|
-
*/
|
|
4
|
-
/** Default base path for Timeback API routes */
|
|
5
|
-
export declare const DEFAULT_BASE_PATH = "/api/timeback";
|
|
6
|
-
/** API route paths */
|
|
7
|
-
export declare const ROUTES: {
|
|
8
|
-
readonly ACTIVITY: "/activity";
|
|
9
|
-
readonly IDENTITY: {
|
|
10
|
-
readonly SIGNIN: "/identity/signin";
|
|
11
|
-
readonly SIGNOUT: "/identity/signout";
|
|
12
|
-
readonly CALLBACK: "/identity/callback";
|
|
13
|
-
};
|
|
14
|
-
readonly USER: {
|
|
15
|
-
readonly ME: "/user/me";
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/shared/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,gDAAgD;AAChD,eAAO,MAAM,iBAAiB,kBAAkB,CAAA;AAEhD,sBAAsB;AACtB,eAAO,MAAM,MAAM;;;;;;;;;;CAUT,CAAA"}
|