@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.
Files changed (57) hide show
  1. package/README.md +32 -0
  2. package/dist/client.d.ts +70 -0
  3. package/dist/client.d.ts.map +1 -0
  4. package/dist/constants.d.ts +24 -0
  5. package/dist/constants.d.ts.map +1 -0
  6. package/dist/errors.js +1405 -0
  7. package/dist/factory.d.ts +46 -0
  8. package/dist/factory.d.ts.map +1 -0
  9. package/dist/index.d.ts +48 -0
  10. package/dist/index.d.ts.map +1 -0
  11. package/dist/index.js +1868 -0
  12. package/dist/lib/index.d.ts +10 -0
  13. package/dist/lib/index.d.ts.map +1 -0
  14. package/dist/lib/pagination.d.ts +27 -0
  15. package/dist/lib/pagination.d.ts.map +1 -0
  16. package/dist/lib/resolve.d.ts +21 -0
  17. package/dist/lib/resolve.d.ts.map +1 -0
  18. package/dist/lib/transport.d.ts +39 -0
  19. package/dist/lib/transport.d.ts.map +1 -0
  20. package/dist/resources/assessment-items.d.ts +87 -0
  21. package/dist/resources/assessment-items.d.ts.map +1 -0
  22. package/dist/resources/assessment-tests.d.ts +225 -0
  23. package/dist/resources/assessment-tests.d.ts.map +1 -0
  24. package/dist/resources/general.d.ts +26 -0
  25. package/dist/resources/general.d.ts.map +1 -0
  26. package/dist/resources/index.d.ts +10 -0
  27. package/dist/resources/index.d.ts.map +1 -0
  28. package/dist/resources/lesson.d.ts +38 -0
  29. package/dist/resources/lesson.d.ts.map +1 -0
  30. package/dist/resources/stimuli.d.ts +64 -0
  31. package/dist/resources/stimuli.d.ts.map +1 -0
  32. package/dist/resources/validate.d.ts +31 -0
  33. package/dist/resources/validate.d.ts.map +1 -0
  34. package/dist/types/api.d.ts +37 -0
  35. package/dist/types/api.d.ts.map +1 -0
  36. package/dist/types/assessment-items.d.ts +82 -0
  37. package/dist/types/assessment-items.d.ts.map +1 -0
  38. package/dist/types/assessment-tests.d.ts +180 -0
  39. package/dist/types/assessment-tests.d.ts.map +1 -0
  40. package/dist/types/base.d.ts +195 -0
  41. package/dist/types/base.d.ts.map +1 -0
  42. package/dist/types/client.d.ts +44 -0
  43. package/dist/types/client.d.ts.map +1 -0
  44. package/dist/types/index.d.ts +14 -0
  45. package/dist/types/index.d.ts.map +1 -0
  46. package/dist/types/lesson.d.ts +38 -0
  47. package/dist/types/lesson.d.ts.map +1 -0
  48. package/dist/types/stimuli.d.ts +56 -0
  49. package/dist/types/stimuli.d.ts.map +1 -0
  50. package/dist/types/validate.d.ts +39 -0
  51. package/dist/types/validate.d.ts.map +1 -0
  52. package/dist/types.d.ts +10 -0
  53. package/dist/types.d.ts.map +1 -0
  54. package/dist/types.js +0 -0
  55. package/dist/utils.d.ts +11 -0
  56. package/dist/utils.d.ts.map +1 -0
  57. 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
+ -->
@@ -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"}