@timeback/case 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 +42 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/constants.d.ts +29 -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 +1730 -0
- package/dist/factory.d.ts +42 -0
- package/dist/factory.d.ts.map +1 -0
- package/dist/index.d.ts +560 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16966 -0
- package/dist/lib/index.d.ts +7 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/resolve.d.ts +19 -0
- package/dist/lib/resolve.d.ts.map +1 -0
- package/dist/lib/transport.d.ts +27 -0
- package/dist/lib/transport.d.ts.map +1 -0
- package/dist/public-types.d.ts +327 -0
- package/dist/public-types.d.ts.map +1 -0
- package/dist/public-types.js +0 -0
- package/dist/resources/associations.d.ts +21 -0
- package/dist/resources/associations.d.ts.map +1 -0
- package/dist/resources/documents.d.ts +30 -0
- package/dist/resources/documents.d.ts.map +1 -0
- package/dist/resources/index.d.ts +8 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/items.d.ts +30 -0
- package/dist/resources/items.d.ts.map +1 -0
- package/dist/resources/packages.d.ts +45 -0
- package/dist/resources/packages.d.ts.map +1 -0
- package/dist/types/client.d.ts +38 -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 +5 -0
- package/dist/utils.d.ts.map +1 -0
- package/package.json +43 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CASE Client Factory
|
|
3
|
+
*
|
|
4
|
+
* Creates CaseClient classes bound to specific provider registries.
|
|
5
|
+
*/
|
|
6
|
+
import { AssociationsResource, DocumentsResource, ItemsResource, PackagesResource } from './resources';
|
|
7
|
+
import type { AuthCheckResult, ProviderRegistry, TimebackProvider } from '@timeback/internal-client-infra';
|
|
8
|
+
import type { CaseClientConfig, CaseTransportLike } from './types';
|
|
9
|
+
/**
|
|
10
|
+
* Create a CaseClient class bound to a specific provider registry.
|
|
11
|
+
*
|
|
12
|
+
* @param registry - Provider registry to use (defaults to all Timeback platforms)
|
|
13
|
+
* @returns CaseClient class bound to the registry
|
|
14
|
+
*/
|
|
15
|
+
export declare function createCaseClient(registry?: ProviderRegistry): {
|
|
16
|
+
new (config?: CaseClientConfig): {
|
|
17
|
+
/** @internal */
|
|
18
|
+
readonly transport: CaseTransportLike;
|
|
19
|
+
/** @internal */
|
|
20
|
+
readonly _provider?: TimebackProvider | undefined;
|
|
21
|
+
/** Query CASE framework documents */
|
|
22
|
+
readonly documents: DocumentsResource;
|
|
23
|
+
/** Query CASE framework items (competencies, standards) */
|
|
24
|
+
readonly items: ItemsResource;
|
|
25
|
+
/** Query CASE framework associations */
|
|
26
|
+
readonly associations: AssociationsResource;
|
|
27
|
+
/** Upload, replace, and retrieve CASE framework packages */
|
|
28
|
+
readonly packages: PackagesResource;
|
|
29
|
+
/**
|
|
30
|
+
* Get the underlying transport for advanced use cases.
|
|
31
|
+
* @returns The transport instance used by this client
|
|
32
|
+
*/
|
|
33
|
+
getTransport(): CaseTransportLike;
|
|
34
|
+
/**
|
|
35
|
+
* Verify that OAuth authentication is working.
|
|
36
|
+
* @returns Auth check result
|
|
37
|
+
* @throws {Error} If client was initialized with custom transport (no provider)
|
|
38
|
+
*/
|
|
39
|
+
checkAuth(): Promise<AuthCheckResult>;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAGtG,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AAC1G,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAElE;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,GAAE,gBAA4C;;QAErF,gBAAgB;;QAGhB,gBAAgB;;QAGhB,qCAAqC;;QAErC,2DAA2D;;QAE3D,wCAAwC;;QAExC,4DAA4D;;QA4C5D;;;WAGG;;QAKH;;;;WAIG;;;EASJ"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,560 @@
|
|
|
1
|
+
import * as _timeback_internal_client_infra from '@timeback/internal-client-infra';
|
|
2
|
+
import { ClientConfig, TransportOnlyConfig, CasePaths, RequestOptions, PaginatedResponse, ProviderClientConfig, TransportConfigWithTokenProvider, ProviderRegistry, TimebackProvider, AuthCheckResult, BaseTransport } from '@timeback/internal-client-infra';
|
|
3
|
+
export { AuthCheckResult, EnvAuth, Environment, ExplicitAuth } from '@timeback/internal-client-infra';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* CASE Base Types
|
|
7
|
+
*
|
|
8
|
+
* Shared types for the CASE (Competency and Academic Standards Exchange) v1p1 API.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* URI reference to a CASE entity.
|
|
13
|
+
*
|
|
14
|
+
* A common pattern across CASE responses for linking to related entities.
|
|
15
|
+
*/
|
|
16
|
+
interface LinkURI {
|
|
17
|
+
sourcedId: string
|
|
18
|
+
title: string
|
|
19
|
+
uri: string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Optional URI reference (uri may be absent).
|
|
24
|
+
*/
|
|
25
|
+
interface OptionalLinkURI {
|
|
26
|
+
sourcedId: string
|
|
27
|
+
title: string
|
|
28
|
+
uri?: string
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* CASE Association Types
|
|
33
|
+
*
|
|
34
|
+
* Types for CASE Framework Associations (CFAssociations).
|
|
35
|
+
* A CFAssociation defines a relationship between two CASE entities.
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* A CASE Framework Association.
|
|
42
|
+
*
|
|
43
|
+
* Defines a typed relationship between two CASE entities
|
|
44
|
+
* (e.g., isChildOf, isRelatedTo, precedes).
|
|
45
|
+
*/
|
|
46
|
+
interface CFAssociation {
|
|
47
|
+
sourcedId: string
|
|
48
|
+
associationType: string
|
|
49
|
+
sequenceNumber?: number
|
|
50
|
+
uri: string
|
|
51
|
+
originNodeURI: LinkURI
|
|
52
|
+
destinationNodeURI: LinkURI
|
|
53
|
+
CFAssociationGroupingURI?: OptionalLinkURI
|
|
54
|
+
lastChangeDateTime: string
|
|
55
|
+
notes?: string
|
|
56
|
+
extensions?: Record<string, unknown>
|
|
57
|
+
CFDocumentURI?: OptionalLinkURI
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* CASE Document Types
|
|
62
|
+
*
|
|
63
|
+
* Types for CASE Framework Documents (CFDocuments).
|
|
64
|
+
* A CFDocument represents a curriculum framework or standards document.
|
|
65
|
+
*/
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* A CASE Framework Document.
|
|
71
|
+
*
|
|
72
|
+
* Represents a curriculum framework or standards document containing
|
|
73
|
+
* items (competencies/standards) and their associations.
|
|
74
|
+
*/
|
|
75
|
+
interface CFDocument {
|
|
76
|
+
sourcedId: string
|
|
77
|
+
title: string
|
|
78
|
+
uri: string
|
|
79
|
+
frameworkType?: string
|
|
80
|
+
caseVersion?: string
|
|
81
|
+
creator: string
|
|
82
|
+
lastChangeDateTime: string
|
|
83
|
+
officialSourceURL?: string
|
|
84
|
+
publisher?: string
|
|
85
|
+
description?: string
|
|
86
|
+
subject?: string[]
|
|
87
|
+
subjectURI?: OptionalLinkURI[]
|
|
88
|
+
language?: string
|
|
89
|
+
version?: string
|
|
90
|
+
adoptionStatus?: string
|
|
91
|
+
statusStartDate?: string
|
|
92
|
+
statusEndDate?: string
|
|
93
|
+
licenseURI?: OptionalLinkURI
|
|
94
|
+
notes?: string
|
|
95
|
+
extensions?: Record<string, unknown>
|
|
96
|
+
CFPackageURI: LinkURI
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* CASE Item Types
|
|
101
|
+
*
|
|
102
|
+
* Types for CASE Framework Items (CFItems).
|
|
103
|
+
* A CFItem represents an individual competency, standard, or learning objective.
|
|
104
|
+
*/
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* A CASE Framework Item.
|
|
110
|
+
*
|
|
111
|
+
* Represents a single competency, standard, or learning objective
|
|
112
|
+
* within a curriculum framework.
|
|
113
|
+
*/
|
|
114
|
+
interface CFItem {
|
|
115
|
+
sourcedId: string
|
|
116
|
+
fullStatement: string
|
|
117
|
+
alternativeLabel?: string
|
|
118
|
+
CFItemType: string
|
|
119
|
+
uri: string
|
|
120
|
+
humanCodingScheme?: string
|
|
121
|
+
listEnumeration?: string
|
|
122
|
+
abbreviatedStatement?: string
|
|
123
|
+
conceptKeywords?: string[]
|
|
124
|
+
conceptKeywordsURI?: OptionalLinkURI
|
|
125
|
+
notes?: string
|
|
126
|
+
subject?: string[]
|
|
127
|
+
subjectURI?: OptionalLinkURI[]
|
|
128
|
+
language?: string
|
|
129
|
+
educationLevel?: string[]
|
|
130
|
+
CFItemTypeURI?: OptionalLinkURI
|
|
131
|
+
licenseURI?: OptionalLinkURI
|
|
132
|
+
statusStartDate?: string
|
|
133
|
+
statusEndDate?: string
|
|
134
|
+
lastChangeDateTime: string
|
|
135
|
+
extensions?: Record<string, unknown>
|
|
136
|
+
CFDocumentURI?: OptionalLinkURI
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* CASE Package Types
|
|
141
|
+
*
|
|
142
|
+
* Types for CASE Framework Packages (CFPackages).
|
|
143
|
+
* A CFPackage is a complete bundle of a document, its items, and associations.
|
|
144
|
+
*/
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* A complete CASE Framework Package.
|
|
150
|
+
*
|
|
151
|
+
* Bundles a CFDocument with all its CFItems and CFAssociations.
|
|
152
|
+
*/
|
|
153
|
+
interface CFPackage {
|
|
154
|
+
sourcedId: string
|
|
155
|
+
CFDocument: CFDocument
|
|
156
|
+
CFItems?: CFItem[]
|
|
157
|
+
CFAssociations?: CFAssociation[]
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* A CASE Framework Package with hierarchical group structure.
|
|
162
|
+
*
|
|
163
|
+
* Extends the standard package with a `structuredContent` field
|
|
164
|
+
* that organizes items into named groups with optional nesting.
|
|
165
|
+
*/
|
|
166
|
+
interface CFPackageWithGroups {
|
|
167
|
+
sourcedId: string
|
|
168
|
+
CFDocument: CFDocument
|
|
169
|
+
structuredContent: Record<string, CFItemWithChildGroups[]>
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* A CFItem extended with optional child group nesting.
|
|
174
|
+
*/
|
|
175
|
+
interface CFItemWithChildGroups extends CFItem {
|
|
176
|
+
childGroups?: Record<string, unknown[]>
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
180
|
+
// PACKAGE INPUT TYPES (for POST/PUT)
|
|
181
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* URI reference used in package input payloads.
|
|
185
|
+
*
|
|
186
|
+
* Package inputs use `identifier` and `uri` instead of `sourcedId`.
|
|
187
|
+
*/
|
|
188
|
+
interface InputNodeURI {
|
|
189
|
+
title: string
|
|
190
|
+
identifier: string
|
|
191
|
+
uri: string
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Document definition within a package upload.
|
|
196
|
+
*/
|
|
197
|
+
interface CFDocumentInput {
|
|
198
|
+
identifier: string
|
|
199
|
+
uri: string
|
|
200
|
+
lastChangeDateTime: string
|
|
201
|
+
title: string
|
|
202
|
+
creator: string
|
|
203
|
+
officialSourceURL?: string
|
|
204
|
+
publisher?: string
|
|
205
|
+
description?: string
|
|
206
|
+
language?: string
|
|
207
|
+
version?: string
|
|
208
|
+
caseVersion?: string
|
|
209
|
+
adoptionStatus?: string
|
|
210
|
+
statusStartDate?: string
|
|
211
|
+
statusEndDate?: string
|
|
212
|
+
licenseUri?: string
|
|
213
|
+
notes?: string
|
|
214
|
+
subject?: string[]
|
|
215
|
+
extensions?: unknown
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Item definition within a package upload.
|
|
220
|
+
*/
|
|
221
|
+
interface CFItemInput {
|
|
222
|
+
identifier: string
|
|
223
|
+
uri: string
|
|
224
|
+
lastChangeDateTime: string
|
|
225
|
+
fullStatement: string
|
|
226
|
+
alternativeLabel?: string
|
|
227
|
+
CFItemType?: string
|
|
228
|
+
cfItemType?: string
|
|
229
|
+
humanCodingScheme?: string
|
|
230
|
+
listEnumeration?: string
|
|
231
|
+
abbreviatedStatement?: string
|
|
232
|
+
conceptKeywords?: string[]
|
|
233
|
+
notes?: string
|
|
234
|
+
subject?: string[]
|
|
235
|
+
language?: string
|
|
236
|
+
educationLevel?: string[]
|
|
237
|
+
CFItemTypeURI?: unknown
|
|
238
|
+
licenseURI?: unknown
|
|
239
|
+
statusStartDate?: string
|
|
240
|
+
statusEndDate?: string
|
|
241
|
+
extensions?: unknown
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Association definition within a package upload.
|
|
246
|
+
*/
|
|
247
|
+
interface CFAssociationInput {
|
|
248
|
+
identifier: string
|
|
249
|
+
uri: string
|
|
250
|
+
lastChangeDateTime: string
|
|
251
|
+
associationType: string
|
|
252
|
+
originNodeURI: InputNodeURI
|
|
253
|
+
destinationNodeURI: InputNodeURI
|
|
254
|
+
sequenceNumber?: number
|
|
255
|
+
extensions?: unknown
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Optional definitions section within a package upload.
|
|
260
|
+
*/
|
|
261
|
+
interface CFDefinitions {
|
|
262
|
+
CFItemTypes?: unknown[]
|
|
263
|
+
CFSubjects?: unknown[]
|
|
264
|
+
CFConcepts?: unknown[]
|
|
265
|
+
CFLicenses?: unknown[]
|
|
266
|
+
CFAssociationGroupings?: unknown[]
|
|
267
|
+
extensions?: unknown
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Input payload for creating or replacing a CASE package.
|
|
272
|
+
*/
|
|
273
|
+
interface CFPackageInput {
|
|
274
|
+
CFDocument: CFDocumentInput
|
|
275
|
+
CFItems: CFItemInput[]
|
|
276
|
+
CFAssociations: CFAssociationInput[]
|
|
277
|
+
CFDefinitions?: CFDefinitions
|
|
278
|
+
extensions?: unknown
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Result returned after uploading or replacing a CASE package.
|
|
283
|
+
*/
|
|
284
|
+
interface CFPackageUploadResult {
|
|
285
|
+
success: boolean
|
|
286
|
+
message: string
|
|
287
|
+
result: {
|
|
288
|
+
documentId: string
|
|
289
|
+
stats: {
|
|
290
|
+
documents: number
|
|
291
|
+
items: number
|
|
292
|
+
associations: number
|
|
293
|
+
}
|
|
294
|
+
success: boolean
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Transport interface for CASE client.
|
|
300
|
+
*/
|
|
301
|
+
interface CaseTransportLike {
|
|
302
|
+
/** Base URL of the API */
|
|
303
|
+
baseUrl: string;
|
|
304
|
+
/** API path profiles for CASE operations */
|
|
305
|
+
paths: CasePaths;
|
|
306
|
+
/** Make an authenticated request */
|
|
307
|
+
request<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
308
|
+
/** Make a paginated request */
|
|
309
|
+
requestPaginated<T>(path: string, options?: RequestOptions): Promise<PaginatedResponse<T>>;
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* All supported CASE client configuration types.
|
|
313
|
+
*/
|
|
314
|
+
type CaseClientConfig = ClientConfig | TransportOnlyConfig<CaseTransportLike> | ProviderClientConfig;
|
|
315
|
+
/**
|
|
316
|
+
* Configuration for CASE transport.
|
|
317
|
+
*/
|
|
318
|
+
interface CaseTransportConfig extends TransportConfigWithTokenProvider {
|
|
319
|
+
/** API path profiles for CASE operations */
|
|
320
|
+
paths: CasePaths;
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Instance type of CaseClient.
|
|
324
|
+
*/
|
|
325
|
+
type CaseClientInstance = InstanceType<typeof CaseClient>;
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* CFAssociations Resource
|
|
329
|
+
*
|
|
330
|
+
* CASE Framework Associations — relationships between CASE entities.
|
|
331
|
+
*/
|
|
332
|
+
|
|
333
|
+
/** CASE Framework Associations resource. */
|
|
334
|
+
declare class AssociationsResource {
|
|
335
|
+
private readonly transport;
|
|
336
|
+
constructor(transport: CaseTransportLike);
|
|
337
|
+
/**
|
|
338
|
+
* Get a CASE association by sourcedId.
|
|
339
|
+
*
|
|
340
|
+
* @param sourcedId - The association's sourcedId
|
|
341
|
+
* @returns The CFAssociation
|
|
342
|
+
*/
|
|
343
|
+
get(sourcedId: string): Promise<{
|
|
344
|
+
CFAssociation: CFAssociation;
|
|
345
|
+
}>;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* CFDocuments Resource
|
|
350
|
+
*
|
|
351
|
+
* CASE Framework Documents — curriculum frameworks and standards documents.
|
|
352
|
+
*/
|
|
353
|
+
|
|
354
|
+
/** CASE Framework Documents resource. */
|
|
355
|
+
declare class DocumentsResource {
|
|
356
|
+
private readonly transport;
|
|
357
|
+
constructor(transport: CaseTransportLike);
|
|
358
|
+
/**
|
|
359
|
+
* List all CASE documents.
|
|
360
|
+
*
|
|
361
|
+
* @param params - Optional query parameters (offset, limit, filter, sort, orderBy)
|
|
362
|
+
* @returns Wrapped response containing CFDocuments array
|
|
363
|
+
*/
|
|
364
|
+
list(params?: Record<string, string | number>): Promise<{
|
|
365
|
+
CFDocuments: CFDocument[];
|
|
366
|
+
}>;
|
|
367
|
+
/**
|
|
368
|
+
* Get a CASE document by sourcedId.
|
|
369
|
+
*
|
|
370
|
+
* @param sourcedId - The document's sourcedId
|
|
371
|
+
* @returns The CFDocument
|
|
372
|
+
*/
|
|
373
|
+
get(sourcedId: string): Promise<{
|
|
374
|
+
CFDocument: CFDocument;
|
|
375
|
+
}>;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* CFItems Resource
|
|
380
|
+
*
|
|
381
|
+
* CASE Framework Items — individual competencies, standards, and learning objectives.
|
|
382
|
+
*/
|
|
383
|
+
|
|
384
|
+
/** CASE Framework Items resource. */
|
|
385
|
+
declare class ItemsResource {
|
|
386
|
+
private readonly transport;
|
|
387
|
+
constructor(transport: CaseTransportLike);
|
|
388
|
+
/**
|
|
389
|
+
* List all CASE items.
|
|
390
|
+
*
|
|
391
|
+
* @param params - Optional query parameters (offset, limit, filter, sort, orderBy)
|
|
392
|
+
* @returns Wrapped response containing CFItems array
|
|
393
|
+
*/
|
|
394
|
+
list(params?: Record<string, string | number>): Promise<{
|
|
395
|
+
CFItems: CFItem[];
|
|
396
|
+
}>;
|
|
397
|
+
/**
|
|
398
|
+
* Get a CASE item by sourcedId.
|
|
399
|
+
*
|
|
400
|
+
* @param sourcedId - The item's sourcedId
|
|
401
|
+
* @returns The CFItem
|
|
402
|
+
*/
|
|
403
|
+
get(sourcedId: string): Promise<{
|
|
404
|
+
CFItem: CFItem;
|
|
405
|
+
}>;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* CFPackages Resource
|
|
410
|
+
*
|
|
411
|
+
* CASE Framework Packages — complete bundles of documents, items, and associations.
|
|
412
|
+
*/
|
|
413
|
+
|
|
414
|
+
/** CASE Framework Packages resource. */
|
|
415
|
+
declare class PackagesResource {
|
|
416
|
+
private readonly transport;
|
|
417
|
+
constructor(transport: CaseTransportLike);
|
|
418
|
+
/**
|
|
419
|
+
* Upload a complete CASE package.
|
|
420
|
+
*
|
|
421
|
+
* @param input - The package to upload (document, items, and associations)
|
|
422
|
+
* @returns Upload result with document ID and stats
|
|
423
|
+
*/
|
|
424
|
+
create(input: CFPackageInput): Promise<CFPackageUploadResult>;
|
|
425
|
+
/**
|
|
426
|
+
* Replace a CASE package by sourcedId.
|
|
427
|
+
*
|
|
428
|
+
* @param sourcedId - The package's document sourcedId
|
|
429
|
+
* @param input - The replacement package
|
|
430
|
+
* @returns Upload result with document ID and stats
|
|
431
|
+
*/
|
|
432
|
+
update(sourcedId: string, input: CFPackageInput): Promise<CFPackageUploadResult>;
|
|
433
|
+
/**
|
|
434
|
+
* Get a CASE package by sourcedId.
|
|
435
|
+
*
|
|
436
|
+
* @param sourcedId - The package's document sourcedId
|
|
437
|
+
* @returns The complete CFPackage
|
|
438
|
+
*/
|
|
439
|
+
get(sourcedId: string): Promise<{
|
|
440
|
+
CFPackage: CFPackage;
|
|
441
|
+
}>;
|
|
442
|
+
/**
|
|
443
|
+
* Get a CASE package with hierarchical group structure.
|
|
444
|
+
*
|
|
445
|
+
* @param sourcedId - The package's document sourcedId
|
|
446
|
+
* @returns The package with items organized into groups
|
|
447
|
+
*/
|
|
448
|
+
getGroups(sourcedId: string): Promise<{
|
|
449
|
+
CFPackageWithGroups: CFPackageWithGroups;
|
|
450
|
+
}>;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* CASE Client
|
|
455
|
+
*
|
|
456
|
+
* Main entry point for the CASE SDK.
|
|
457
|
+
*/
|
|
458
|
+
/**
|
|
459
|
+
* CASE API client for Competency and Academic Standards Exchange.
|
|
460
|
+
*
|
|
461
|
+
* Provides access to CASE endpoints including documents, items,
|
|
462
|
+
* associations, and package management.
|
|
463
|
+
*
|
|
464
|
+
* @example
|
|
465
|
+
* ```typescript
|
|
466
|
+
* const client = new CaseClient({
|
|
467
|
+
* env: 'staging',
|
|
468
|
+
* auth: {
|
|
469
|
+
* clientId: 'your-client-id',
|
|
470
|
+
* clientSecret: 'your-client-secret',
|
|
471
|
+
* },
|
|
472
|
+
* })
|
|
473
|
+
*
|
|
474
|
+
* // List all framework documents
|
|
475
|
+
* const docs = await client.documents.list()
|
|
476
|
+
*
|
|
477
|
+
* // Get a specific package
|
|
478
|
+
* const pkg = await client.packages.get(sourcedId)
|
|
479
|
+
* ```
|
|
480
|
+
*/
|
|
481
|
+
declare const CaseClient: {
|
|
482
|
+
new (config?: CaseClientConfig): {
|
|
483
|
+
readonly transport: CaseTransportLike;
|
|
484
|
+
readonly _provider?: _timeback_internal_client_infra.TimebackProvider | undefined;
|
|
485
|
+
readonly documents: DocumentsResource;
|
|
486
|
+
readonly items: ItemsResource;
|
|
487
|
+
readonly associations: AssociationsResource;
|
|
488
|
+
readonly packages: PackagesResource;
|
|
489
|
+
getTransport(): CaseTransportLike;
|
|
490
|
+
checkAuth(): Promise<_timeback_internal_client_infra.AuthCheckResult>;
|
|
491
|
+
};
|
|
492
|
+
};
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* CASE Client Factory
|
|
496
|
+
*
|
|
497
|
+
* Creates CaseClient classes bound to specific provider registries.
|
|
498
|
+
*/
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* Create a CaseClient class bound to a specific provider registry.
|
|
502
|
+
*
|
|
503
|
+
* @param registry - Provider registry to use (defaults to all Timeback platforms)
|
|
504
|
+
* @returns CaseClient class bound to the registry
|
|
505
|
+
*/
|
|
506
|
+
declare function createCaseClient(registry?: ProviderRegistry): {
|
|
507
|
+
new (config?: CaseClientConfig): {
|
|
508
|
+
/** @internal */
|
|
509
|
+
readonly transport: CaseTransportLike;
|
|
510
|
+
/** @internal */
|
|
511
|
+
readonly _provider?: TimebackProvider | undefined;
|
|
512
|
+
/** Query CASE framework documents */
|
|
513
|
+
readonly documents: DocumentsResource;
|
|
514
|
+
/** Query CASE framework items (competencies, standards) */
|
|
515
|
+
readonly items: ItemsResource;
|
|
516
|
+
/** Query CASE framework associations */
|
|
517
|
+
readonly associations: AssociationsResource;
|
|
518
|
+
/** Upload, replace, and retrieve CASE framework packages */
|
|
519
|
+
readonly packages: PackagesResource;
|
|
520
|
+
/**
|
|
521
|
+
* Get the underlying transport for advanced use cases.
|
|
522
|
+
* @returns The transport instance used by this client
|
|
523
|
+
*/
|
|
524
|
+
getTransport(): CaseTransportLike;
|
|
525
|
+
/**
|
|
526
|
+
* Verify that OAuth authentication is working.
|
|
527
|
+
* @returns Auth check result
|
|
528
|
+
* @throws {Error} If client was initialized with custom transport (no provider)
|
|
529
|
+
*/
|
|
530
|
+
checkAuth(): Promise<AuthCheckResult>;
|
|
531
|
+
};
|
|
532
|
+
};
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* Transport Layer
|
|
536
|
+
*
|
|
537
|
+
* HTTP transport for CASE API communication.
|
|
538
|
+
*/
|
|
539
|
+
|
|
540
|
+
/**
|
|
541
|
+
* HTTP transport layer for CASE API communication.
|
|
542
|
+
*
|
|
543
|
+
* Uses header-based pagination (same as OneRoster) for list endpoints.
|
|
544
|
+
*/
|
|
545
|
+
declare class Transport extends BaseTransport {
|
|
546
|
+
readonly paths: CasePaths;
|
|
547
|
+
constructor(config: CaseTransportConfig);
|
|
548
|
+
/**
|
|
549
|
+
* Make a paginated request using header-based pagination.
|
|
550
|
+
*
|
|
551
|
+
* @template T - Expected item type in the response array
|
|
552
|
+
* @param path - API endpoint path
|
|
553
|
+
* @param options - Request options
|
|
554
|
+
* @returns Response data with hasMore flag and optional total count
|
|
555
|
+
*/
|
|
556
|
+
requestPaginated<T>(path: string, options?: RequestOptions): Promise<PaginatedResponse<T>>;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
export { CaseClient, Transport, createCaseClient };
|
|
560
|
+
export type { CFAssociation, CFAssociationInput, CFDefinitions, CFDocument, CFDocumentInput, CFItem, CFItemInput, CFItemWithChildGroups, CFPackage, CFPackageInput, CFPackageUploadResult, CFPackageWithGroups, CaseClientConfig, CaseClientInstance, InputNodeURI, LinkURI, OptionalLinkURI };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAMH,OAAO,EAAE,UAAU,EAAE,KAAK,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAE5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAMtD,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAExE,YAAY,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AAEtE,YAAY,EACX,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,UAAU,EACV,eAAe,EACf,MAAM,EACN,WAAW,EACX,qBAAqB,EACrB,SAAS,EACT,cAAc,EACd,qBAAqB,EACrB,mBAAmB,EACnB,YAAY,EACZ,OAAO,EACP,eAAe,GACf,MAAM,gCAAgC,CAAA;AAMvC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA"}
|