@timeback/powerpath 0.1.3 → 0.1.5-beta.20260219190739

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/errors.d.ts CHANGED
@@ -1,9 +1 @@
1
- /**
2
- * PowerPath Error Classes
3
- *
4
- * Re-exports common errors from `@timeback/internal-client-infra`.
5
- * PowerPath uses the same error format as other Timeback clients.
6
- */
7
- import { ApiError, ForbiddenError, InputValidationError, NotFoundError, UnauthorizedError, ValidationError } from '@timeback/internal-client-infra';
8
- export { ApiError as PowerPathError, ForbiddenError, InputValidationError, NotFoundError, UnauthorizedError, ValidationError, };
9
- //# sourceMappingURL=errors.d.ts.map
1
+ export { ForbiddenError, InputValidationError, NotFoundError, ApiError as PowerPathError, UnauthorizedError, ValidationError } from '@timeback/internal-client-infra';
package/dist/errors.js CHANGED
@@ -884,6 +884,28 @@ var BEYONDAI_PATHS = {
884
884
  },
885
885
  powerpath: {
886
886
  base: "/powerpath"
887
+ },
888
+ clr: {
889
+ credentials: "/ims/clr/v2p0/credentials",
890
+ discovery: "/ims/clr/v2p0/discovery"
891
+ },
892
+ case: {
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}"
887
909
  }
888
910
  };
889
911
  var LEARNWITHAI_PATHS = {
@@ -899,8 +921,11 @@ var LEARNWITHAI_PATHS = {
899
921
  gradebook: "/gradebook/1.0",
900
922
  resources: "/resources/1.0"
901
923
  },
924
+ webhooks: null,
902
925
  edubridge: null,
903
- powerpath: null
926
+ powerpath: null,
927
+ clr: null,
928
+ case: null
904
929
  };
905
930
  var PLATFORM_PATHS = {
906
931
  BEYOND_AI: BEYONDAI_PATHS,
@@ -922,8 +947,11 @@ function resolvePathProfiles(pathProfile, customPaths) {
922
947
  return {
923
948
  caliper: customPaths?.caliper ?? basePaths.caliper,
924
949
  oneroster: customPaths?.oneroster ?? basePaths.oneroster,
950
+ webhooks: customPaths?.webhooks ?? basePaths.webhooks,
925
951
  edubridge: customPaths?.edubridge ?? basePaths.edubridge,
926
- powerpath: customPaths?.powerpath ?? basePaths.powerpath
952
+ powerpath: customPaths?.powerpath ?? basePaths.powerpath,
953
+ clr: customPaths?.clr ?? basePaths.clr,
954
+ case: customPaths?.case ?? basePaths.case
927
955
  };
928
956
  }
929
957
 
@@ -963,10 +991,22 @@ class TimebackProvider {
963
991
  baseUrl: platformEndpoints.api[env],
964
992
  authUrl: this.authUrl
965
993
  },
994
+ clr: {
995
+ baseUrl: platformEndpoints.api[env],
996
+ authUrl: this.authUrl
997
+ },
998
+ case: {
999
+ baseUrl: platformEndpoints.api[env],
1000
+ authUrl: this.authUrl
1001
+ },
966
1002
  caliper: {
967
1003
  baseUrl: platformEndpoints.caliper[env],
968
1004
  authUrl: this.authUrl
969
1005
  },
1006
+ webhooks: {
1007
+ baseUrl: platformEndpoints.caliper[env],
1008
+ authUrl: this.authUrl
1009
+ },
970
1010
  qti: {
971
1011
  baseUrl: platformEndpoints.qti[env],
972
1012
  authUrl: this.authUrl
@@ -980,7 +1020,10 @@ class TimebackProvider {
980
1020
  oneroster: { baseUrl: config.baseUrl, authUrl: this.authUrl },
981
1021
  edubridge: { baseUrl: config.baseUrl, authUrl: this.authUrl },
982
1022
  powerpath: { baseUrl: config.baseUrl, authUrl: this.authUrl },
1023
+ clr: { baseUrl: config.baseUrl, authUrl: this.authUrl },
1024
+ case: { baseUrl: config.baseUrl, authUrl: this.authUrl },
983
1025
  caliper: { baseUrl: config.baseUrl, authUrl: this.authUrl },
1026
+ webhooks: { baseUrl: config.baseUrl, authUrl: this.authUrl },
984
1027
  qti: { baseUrl: config.baseUrl, authUrl: this.authUrl }
985
1028
  };
986
1029
  } else if (isServicesConfig(config)) {
@@ -999,10 +1042,19 @@ class TimebackProvider {
999
1042
  } else {
1000
1043
  throw new Error("Invalid provider configuration");
1001
1044
  }
1045
+ for (const service of Object.keys(this.pathProfiles)) {
1046
+ if (this.pathProfiles[service] === null) {
1047
+ delete this.endpoints[service];
1048
+ }
1049
+ }
1002
1050
  }
1003
1051
  getEndpoint(service) {
1004
1052
  const endpoint = this.endpoints[service];
1005
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
+ }
1006
1058
  throw new Error(`Service "${service}" is not configured in this provider`);
1007
1059
  }
1008
1060
  return endpoint;