@timeback/clr 0.1.0
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/dist/client.d.ts +70 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/constants.d.ts +30 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/errors.d.ts +1 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +1703 -0
- package/dist/factory.d.ts +38 -0
- package/dist/factory.d.ts.map +1 -0
- package/dist/index.d.ts +589 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16884 -0
- package/dist/lib/index.d.ts +9 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/resolve.d.ts +21 -0
- package/dist/lib/resolve.d.ts.map +1 -0
- package/dist/lib/transport.d.ts +21 -0
- package/dist/lib/transport.d.ts.map +1 -0
- package/dist/public-types.d.ts +376 -0
- package/dist/public-types.d.ts.map +1 -0
- package/dist/public-types.js +0 -0
- package/dist/resources/credentials.d.ts +54 -0
- package/dist/resources/credentials.d.ts.map +1 -0
- package/dist/resources/discovery.d.ts +41 -0
- package/dist/resources/discovery.d.ts.map +1 -0
- package/dist/resources/index.d.ts +6 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/types/client.d.ts +48 -0
- package/dist/types/client.d.ts.map +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types.d.ts +10 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils.d.ts +11 -0
- package/dist/utils.d.ts.map +1 -0
- package/package.json +43 -0
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLR Client
|
|
3
|
+
*
|
|
4
|
+
* Main entry point for the CLR SDK.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* CLR API client for Comprehensive Learner Record management.
|
|
8
|
+
*
|
|
9
|
+
* Provides access to CLR endpoints including credential upsert
|
|
10
|
+
* and API discovery.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* // Environment mode (Timeback APIs)
|
|
15
|
+
* const client = new ClrClient({
|
|
16
|
+
* env: 'staging', // or 'production'
|
|
17
|
+
* auth: {
|
|
18
|
+
* clientId: 'your-client-id',
|
|
19
|
+
* clientSecret: 'your-client-secret',
|
|
20
|
+
* },
|
|
21
|
+
* })
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* // Provider mode (shared tokens)
|
|
27
|
+
* import { TimebackProvider } from '@timeback/internal-client-infra'
|
|
28
|
+
*
|
|
29
|
+
* const provider = new TimebackProvider({
|
|
30
|
+
* platform: 'BEYOND_AI',
|
|
31
|
+
* env: 'staging',
|
|
32
|
+
* auth: { clientId: '...', clientSecret: '...' },
|
|
33
|
+
* })
|
|
34
|
+
*
|
|
35
|
+
* const client = new ClrClient({ provider })
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```typescript
|
|
40
|
+
* // Explicit mode (custom API)
|
|
41
|
+
* const client = new ClrClient({
|
|
42
|
+
* baseUrl: 'https://api.example.com',
|
|
43
|
+
* auth: {
|
|
44
|
+
* clientId: 'your-client-id',
|
|
45
|
+
* clientSecret: 'your-client-secret',
|
|
46
|
+
* authUrl: 'https://auth.example.com/oauth2/token',
|
|
47
|
+
* },
|
|
48
|
+
* })
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```typescript
|
|
53
|
+
* // Environment variables fallback
|
|
54
|
+
* // Set CLR_BASE_URL, CLR_TOKEN_URL,
|
|
55
|
+
* // CLR_CLIENT_ID, CLR_CLIENT_SECRET
|
|
56
|
+
* const client = new ClrClient()
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export declare const ClrClient: {
|
|
60
|
+
new (config?: import("./types").ClrClientConfig): {
|
|
61
|
+
readonly transport: import("./types").ClrTransportLike;
|
|
62
|
+
readonly _provider?: import("@timeback/internal-client-infra").TimebackProvider | undefined;
|
|
63
|
+
readonly credentials: import("./resources").CredentialsResource;
|
|
64
|
+
readonly discovery: import("./resources").DiscoveryResource;
|
|
65
|
+
getTransport(): import("./types").ClrTransportLike;
|
|
66
|
+
checkAuth(): Promise<import("@timeback/internal-client-infra").AuthCheckResult>;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
export type { ClrClientInstance } from './types';
|
|
70
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,eAAO,MAAM,SAAS;;;;;;;;;CAAoB,CAAA;AAE1C,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLR Constants
|
|
3
|
+
*
|
|
4
|
+
* Configuration constants for the CLR client.
|
|
5
|
+
*/
|
|
6
|
+
import type { ClientUrlMaps, Platform } from '@timeback/internal-client-infra';
|
|
7
|
+
/**
|
|
8
|
+
* Environment variable names for fallback config.
|
|
9
|
+
*
|
|
10
|
+
* Supports fallback chains - tries each env var in order until one is defined:
|
|
11
|
+
* - `TIMEBACK_API_*` (canonical/preferred)
|
|
12
|
+
* - `TIMEBACK_*` (unified Timeback shorthand)
|
|
13
|
+
* - `CLR_*` (service-specific)
|
|
14
|
+
*/
|
|
15
|
+
export declare const CLR_ENV_VARS: {
|
|
16
|
+
readonly baseUrl: readonly ["TIMEBACK_API_BASE_URL", "TIMEBACK_BASE_URL", "CLR_BASE_URL"];
|
|
17
|
+
readonly clientId: readonly ["TIMEBACK_API_CLIENT_ID", "TIMEBACK_CLIENT_ID", "CLR_CLIENT_ID"];
|
|
18
|
+
readonly clientSecret: readonly ["TIMEBACK_API_CLIENT_SECRET", "TIMEBACK_CLIENT_SECRET", "CLR_CLIENT_SECRET"];
|
|
19
|
+
readonly authUrl: readonly ["TIMEBACK_API_AUTH_URL", "TIMEBACK_AUTH_URL", "CLR_TOKEN_URL"];
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Get URL maps for a specific platform.
|
|
23
|
+
* Defaults to 'BEYOND_AI' for backwards compatibility.
|
|
24
|
+
*
|
|
25
|
+
* Note: CLR uses the main API server (same as OneRoster/Edubridge).
|
|
26
|
+
* @param platform - Platform name
|
|
27
|
+
* @returns Client URL maps for the platform
|
|
28
|
+
*/
|
|
29
|
+
export declare function getUrlMapsForPlatform(platform?: Platform): ClientUrlMaps;
|
|
30
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAA;AAM9E;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY;;;;;CAKf,CAAA;AAMV;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,GAAE,QAA2B,GAAG,aAAa,CAM1F"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ApiError as ClrError, ForbiddenError, InputValidationError, NotFoundError, UnauthorizedError, ValidationError } from '@timeback/internal-client-infra';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACN,QAAQ,EACR,cAAc,EACd,oBAAoB,EACpB,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,MAAM,iCAAiC,CAAA;AAExC,OAAO,EACN,QAAQ,IAAI,QAAQ,EACpB,cAAc,EACd,oBAAoB,EACpB,aAAa,EACb,iBAAiB,EACjB,eAAe,GACf,CAAA"}
|