@timeback/qti 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/README.md +32 -0
- package/dist/client.d.ts +70 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/constants.d.ts +24 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/errors.js +1405 -0
- package/dist/factory.d.ts +46 -0
- package/dist/factory.d.ts.map +1 -0
- package/dist/index.d.ts +48 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1868 -0
- package/dist/lib/index.d.ts +10 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/pagination.d.ts +27 -0
- package/dist/lib/pagination.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 +39 -0
- package/dist/lib/transport.d.ts.map +1 -0
- package/dist/resources/assessment-items.d.ts +87 -0
- package/dist/resources/assessment-items.d.ts.map +1 -0
- package/dist/resources/assessment-tests.d.ts +225 -0
- package/dist/resources/assessment-tests.d.ts.map +1 -0
- package/dist/resources/general.d.ts +26 -0
- package/dist/resources/general.d.ts.map +1 -0
- package/dist/resources/index.d.ts +10 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/lesson.d.ts +38 -0
- package/dist/resources/lesson.d.ts.map +1 -0
- package/dist/resources/stimuli.d.ts +64 -0
- package/dist/resources/stimuli.d.ts.map +1 -0
- package/dist/resources/validate.d.ts +31 -0
- package/dist/resources/validate.d.ts.map +1 -0
- package/dist/types/api.d.ts +37 -0
- package/dist/types/api.d.ts.map +1 -0
- package/dist/types/assessment-items.d.ts +82 -0
- package/dist/types/assessment-items.d.ts.map +1 -0
- package/dist/types/assessment-tests.d.ts +180 -0
- package/dist/types/assessment-tests.d.ts.map +1 -0
- package/dist/types/base.d.ts +195 -0
- package/dist/types/base.d.ts.map +1 -0
- package/dist/types/client.d.ts +44 -0
- package/dist/types/client.d.ts.map +1 -0
- package/dist/types/index.d.ts +14 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/lesson.d.ts +38 -0
- package/dist/types/lesson.d.ts.map +1 -0
- package/dist/types/stimuli.d.ts +56 -0
- package/dist/types/stimuli.d.ts.map +1 -0
- package/dist/types/validate.d.ts +39 -0
- package/dist/types/validate.d.ts.map +1 -0
- package/dist/types.d.ts +10 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +0 -0
- package/dist/utils.d.ts +11 -0
- package/dist/utils.d.ts.map +1 -0
- package/package.json +39 -0
package/README.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# @timeback/qti
|
|
2
|
+
|
|
3
|
+
<!-- One sentence: what does this package do? No "This package provides..." -->
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
bun add @timeback/qti
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import '@timeback/qti'
|
|
15
|
+
|
|
16
|
+
// Minimal working example (<10 lines)
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
<!--
|
|
20
|
+
Optional sections (add only if relevant):
|
|
21
|
+
|
|
22
|
+
## API / Features
|
|
23
|
+
For packages with multiple exports or complex APIs.
|
|
24
|
+
|
|
25
|
+
## Configuration
|
|
26
|
+
For packages with env vars or options.
|
|
27
|
+
|
|
28
|
+
## Debug Mode
|
|
29
|
+
If the package supports DEBUG=1 or similar.
|
|
30
|
+
|
|
31
|
+
See docs/guidelines/readmes.md for full guidance.
|
|
32
|
+
-->
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QTI Client
|
|
3
|
+
*
|
|
4
|
+
* Main entry point for the QTI SDK.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* QTI API client for assessment content management.
|
|
8
|
+
*
|
|
9
|
+
* Provides access to QTI endpoints including assessment items, tests,
|
|
10
|
+
* stimuli, validation, and lesson feedback.
|
|
11
|
+
*
|
|
12
|
+
* @example Environment mode (Timeback APIs)
|
|
13
|
+
* ```typescript
|
|
14
|
+
* const client = new QtiClient({
|
|
15
|
+
* env: 'staging', // or 'production'
|
|
16
|
+
* auth: {
|
|
17
|
+
* clientId: 'your-client-id',
|
|
18
|
+
* clientSecret: 'your-client-secret',
|
|
19
|
+
* },
|
|
20
|
+
* })
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @example Provider mode (shared tokens)
|
|
24
|
+
* ```typescript
|
|
25
|
+
* import { TimebackProvider } from '@timeback/internal-client-infra'
|
|
26
|
+
*
|
|
27
|
+
* const provider = new TimebackProvider({
|
|
28
|
+
* platform: 'BEYOND_AI',
|
|
29
|
+
* env: 'staging',
|
|
30
|
+
* auth: { clientId: '...', clientSecret: '...' },
|
|
31
|
+
* })
|
|
32
|
+
*
|
|
33
|
+
* const client = new QtiClient({ provider })
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @example Explicit mode (custom API)
|
|
37
|
+
* ```typescript
|
|
38
|
+
* const client = new QtiClient({
|
|
39
|
+
* baseUrl: 'https://qti.example.com/api',
|
|
40
|
+
* auth: {
|
|
41
|
+
* clientId: 'your-client-id',
|
|
42
|
+
* clientSecret: 'your-client-secret',
|
|
43
|
+
* authUrl: 'https://auth.example.com/oauth2/token',
|
|
44
|
+
* },
|
|
45
|
+
* })
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @example Environment variables fallback
|
|
49
|
+
* ```typescript
|
|
50
|
+
* // Set QTI_BASE_URL, QTI_TOKEN_URL,
|
|
51
|
+
* // QTI_CLIENT_ID, QTI_CLIENT_SECRET
|
|
52
|
+
* const client = new QtiClient()
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare const QtiClient: {
|
|
56
|
+
new (config?: import("./types").QtiClientConfig): {
|
|
57
|
+
readonly transport: import("./types").QtiTransportLike;
|
|
58
|
+
readonly _provider?: import("@timeback/internal-client-infra").TimebackProvider | undefined;
|
|
59
|
+
readonly assessmentItems: import("./resources").AssessmentItemsResource;
|
|
60
|
+
readonly assessmentTests: import("./resources").AssessmentTestsResource;
|
|
61
|
+
readonly stimuli: import("./resources").StimuliResource;
|
|
62
|
+
readonly validate: import("./resources").ValidateResource;
|
|
63
|
+
readonly lesson: import("./resources").LessonResource;
|
|
64
|
+
readonly general: import("./resources").GeneralResource;
|
|
65
|
+
getTransport(): import("./types").QtiTransportLike;
|
|
66
|
+
checkAuth(): Promise<import("@timeback/internal-client-infra").AuthCheckResult>;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
export type { QtiClientInstance } 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;CAAoB,CAAA;AAE1C,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QTI Constants
|
|
3
|
+
*
|
|
4
|
+
* Configuration constants for the QTI client.
|
|
5
|
+
*/
|
|
6
|
+
import type { ClientUrlMaps, Platform } from '@timeback/internal-client-infra';
|
|
7
|
+
/**
|
|
8
|
+
* Environment variable names for fallback config.
|
|
9
|
+
*/
|
|
10
|
+
export declare const QTI_ENV_VARS: {
|
|
11
|
+
readonly baseUrl: "QTI_BASE_URL";
|
|
12
|
+
readonly clientId: "QTI_CLIENT_ID";
|
|
13
|
+
readonly clientSecret: "QTI_CLIENT_SECRET";
|
|
14
|
+
readonly authUrl: "QTI_TOKEN_URL";
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Get URL maps for a specific platform.
|
|
18
|
+
* Defaults to 'BEYOND_AI' for backwards compatibility.
|
|
19
|
+
*
|
|
20
|
+
* @param platform - Platform name
|
|
21
|
+
* @returns Client URL maps for the platform
|
|
22
|
+
*/
|
|
23
|
+
export declare function getUrlMapsForPlatform(platform?: Platform): ClientUrlMaps;
|
|
24
|
+
//# 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;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;CAKf,CAAA;AAMV;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,GAAE,QAA2B,GAAG,aAAa,CAM1F"}
|