@timeback/core 0.1.6 → 0.1.7-beta.20260219221746
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 +12 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/errors.js +31 -0
- package/dist/index.js +19219 -1187
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types.js +13 -6
- package/dist/utils.js +283 -144
- package/package.json +4 -3
package/dist/client.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import type { AuthCheckResult, TimebackProvider } from '@timeback/internal-clien
|
|
|
6
6
|
import type { OneRosterClientInstance } from '@timeback/oneroster';
|
|
7
7
|
import type { PowerPathClientInstance } from '@timeback/powerpath';
|
|
8
8
|
import type { QtiClientInstance } from '@timeback/qti';
|
|
9
|
+
import type { WebhooksClientInstance } from '@timeback/webhooks';
|
|
9
10
|
import type { TimebackClientConfig } from './types/index';
|
|
10
11
|
/**
|
|
11
12
|
* Timeback Client
|
|
@@ -82,6 +83,7 @@ export declare class TimebackClient {
|
|
|
82
83
|
private _powerpath?;
|
|
83
84
|
private _clr?;
|
|
84
85
|
private _case?;
|
|
86
|
+
private _webhooks?;
|
|
85
87
|
/**
|
|
86
88
|
* Creates a new Timeback client.
|
|
87
89
|
*
|
|
@@ -160,6 +162,16 @@ export declare class TimebackClient {
|
|
|
160
162
|
* @throws {Error} If client has been closed or service not configured
|
|
161
163
|
*/
|
|
162
164
|
get case(): CaseClientInstance;
|
|
165
|
+
/**
|
|
166
|
+
* Webhooks API client for managing webhook registrations and filters.
|
|
167
|
+
*
|
|
168
|
+
* Lazily initialized on first access. Shares OAuth tokens with other
|
|
169
|
+
* sub-clients through the provider.
|
|
170
|
+
*
|
|
171
|
+
* @returns The Webhooks client instance
|
|
172
|
+
* @throws {Error} If client has been closed or service not configured
|
|
173
|
+
*/
|
|
174
|
+
get webhooks(): WebhooksClientInstance;
|
|
163
175
|
/**
|
|
164
176
|
* Verify that OAuth authentication is working.
|
|
165
177
|
*
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAA;AAC9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AACxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AACxF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAClE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAClE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AAEzD;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,qBAAa,cAAc;IAC1B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkB;IAC3C,OAAO,CAAC,OAAO,CAAQ;IAEvB,OAAO,CAAC,UAAU,CAAC,CAAyB;IAC5C,OAAO,CAAC,UAAU,CAAC,CAAyB;IAC5C,OAAO,CAAC,QAAQ,CAAC,CAAuB;IACxC,OAAO,CAAC,IAAI,CAAC,CAAmB;IAChC,OAAO,CAAC,UAAU,CAAC,CAAyB;IAC5C,OAAO,CAAC,IAAI,CAAC,CAAmB;IAChC,OAAO,CAAC,KAAK,CAAC,CAAoB;IAClC,OAAO,CAAC,SAAS,CAAC,CAAwB;IAE1C;;;;;;OAMG;IACH,YAAY,MAAM,CAAC,EAAE,oBAAoB,EAUxC;IAED;;;;;;;;OAQG;IACH,IAAI,SAAS,IAAI,uBAAuB,CASvC;IAED;;;;;;;;OAQG;IACH,IAAI,SAAS,IAAI,uBAAuB,CASvC;IAED;;;;;;;;OAQG;IACH,IAAI,OAAO,IAAI,qBAAqB,CASnC;IAED;;;;;;;;OAQG;IACH,IAAI,GAAG,IAAI,iBAAiB,CAS3B;IAED;;;;;;;;OAQG;IACH,IAAI,SAAS,IAAI,uBAAuB,CASvC;IAED;;;;;;;;OAQG;IACH,IAAI,GAAG,IAAI,iBAAiB,CAS3B;IAED;;;;;;;;OAQG;IACH,IAAI,IAAI,IAAI,kBAAkB,CAS7B;IAED;;;;;;;;OAQG;IACH,IAAI,QAAQ,IAAI,sBAAsB,CASrC;IAMD;;;;;;;;OAQG;IACH,SAAS,IAAI,OAAO,CAAC,eAAe,CAAC,CAGpC;IAED;;;;;;;OAOG;IACH,KAAK,IAAI,IAAI,CAeZ;IAED;;;OAGG;IACH,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED;;;;OAIG;IACH,WAAW,IAAI,gBAAgB,CAE9B;IAED;;OAEG;IACH,OAAO,CAAC,UAAU;IAMlB;;;OAGG;IACH,OAAO,CAAC,aAAa;CAOrB"}
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAMpE;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,EAAE,cAM/B,CAAA;AAMD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CACnC,GAAG,EAAE,WAAW,EAChB,QAAQ,GAAE,QAA2B,GACnC,cAAc,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAMpE;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,EAAE,cAM/B,CAAA;AAMD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CACnC,GAAG,EAAE,WAAW,EAChB,QAAQ,GAAE,QAA2B,GACnC,cAAc,CAUhB"}
|
package/dist/errors.js
CHANGED
|
@@ -891,6 +891,21 @@ var BEYONDAI_PATHS = {
|
|
|
891
891
|
},
|
|
892
892
|
case: {
|
|
893
893
|
base: "/ims/case/v1p1"
|
|
894
|
+
},
|
|
895
|
+
webhooks: {
|
|
896
|
+
webhookList: "/webhooks/",
|
|
897
|
+
webhookGet: "/webhooks/{id}",
|
|
898
|
+
webhookCreate: "/webhooks/",
|
|
899
|
+
webhookUpdate: "/webhooks/{id}",
|
|
900
|
+
webhookDelete: "/webhooks/{id}",
|
|
901
|
+
webhookActivate: "/webhooks/{id}/activate",
|
|
902
|
+
webhookDeactivate: "/webhooks/{id}/deactivate",
|
|
903
|
+
webhookFilterList: "/webhook-filters/",
|
|
904
|
+
webhookFilterGet: "/webhook-filters/{id}",
|
|
905
|
+
webhookFilterCreate: "/webhook-filters/",
|
|
906
|
+
webhookFilterUpdate: "/webhook-filters/{id}",
|
|
907
|
+
webhookFilterDelete: "/webhook-filters/{id}",
|
|
908
|
+
webhookFiltersByWebhook: "/webhook-filters/webhook/{webhookId}"
|
|
894
909
|
}
|
|
895
910
|
};
|
|
896
911
|
var LEARNWITHAI_PATHS = {
|
|
@@ -906,6 +921,7 @@ var LEARNWITHAI_PATHS = {
|
|
|
906
921
|
gradebook: "/gradebook/1.0",
|
|
907
922
|
resources: "/resources/1.0"
|
|
908
923
|
},
|
|
924
|
+
webhooks: null,
|
|
909
925
|
edubridge: null,
|
|
910
926
|
powerpath: null,
|
|
911
927
|
clr: null,
|
|
@@ -931,6 +947,7 @@ function resolvePathProfiles(pathProfile, customPaths) {
|
|
|
931
947
|
return {
|
|
932
948
|
caliper: customPaths?.caliper ?? basePaths.caliper,
|
|
933
949
|
oneroster: customPaths?.oneroster ?? basePaths.oneroster,
|
|
950
|
+
webhooks: customPaths?.webhooks ?? basePaths.webhooks,
|
|
934
951
|
edubridge: customPaths?.edubridge ?? basePaths.edubridge,
|
|
935
952
|
powerpath: customPaths?.powerpath ?? basePaths.powerpath,
|
|
936
953
|
clr: customPaths?.clr ?? basePaths.clr,
|
|
@@ -986,6 +1003,10 @@ class TimebackProvider {
|
|
|
986
1003
|
baseUrl: platformEndpoints.caliper[env],
|
|
987
1004
|
authUrl: this.authUrl
|
|
988
1005
|
},
|
|
1006
|
+
webhooks: {
|
|
1007
|
+
baseUrl: platformEndpoints.caliper[env],
|
|
1008
|
+
authUrl: this.authUrl
|
|
1009
|
+
},
|
|
989
1010
|
qti: {
|
|
990
1011
|
baseUrl: platformEndpoints.qti[env],
|
|
991
1012
|
authUrl: this.authUrl
|
|
@@ -1002,6 +1023,7 @@ class TimebackProvider {
|
|
|
1002
1023
|
clr: { baseUrl: config.baseUrl, authUrl: this.authUrl },
|
|
1003
1024
|
case: { baseUrl: config.baseUrl, authUrl: this.authUrl },
|
|
1004
1025
|
caliper: { baseUrl: config.baseUrl, authUrl: this.authUrl },
|
|
1026
|
+
webhooks: { baseUrl: config.baseUrl, authUrl: this.authUrl },
|
|
1005
1027
|
qti: { baseUrl: config.baseUrl, authUrl: this.authUrl }
|
|
1006
1028
|
};
|
|
1007
1029
|
} else if (isServicesConfig(config)) {
|
|
@@ -1020,10 +1042,19 @@ class TimebackProvider {
|
|
|
1020
1042
|
} else {
|
|
1021
1043
|
throw new Error("Invalid provider configuration");
|
|
1022
1044
|
}
|
|
1045
|
+
for (const service of Object.keys(this.pathProfiles)) {
|
|
1046
|
+
if (this.pathProfiles[service] === null) {
|
|
1047
|
+
delete this.endpoints[service];
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1023
1050
|
}
|
|
1024
1051
|
getEndpoint(service) {
|
|
1025
1052
|
const endpoint = this.endpoints[service];
|
|
1026
1053
|
if (!endpoint) {
|
|
1054
|
+
const pathKey = service;
|
|
1055
|
+
if (pathKey in this.pathProfiles && this.pathProfiles[pathKey] === null) {
|
|
1056
|
+
throw new Error(`Service "${service}" is not supported on ${this.platform ?? "this"} platform.`);
|
|
1057
|
+
}
|
|
1027
1058
|
throw new Error(`Service "${service}" is not configured in this provider`);
|
|
1028
1059
|
}
|
|
1029
1060
|
return endpoint;
|