@timeback/oneroster 0.1.4 → 0.1.6

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/index.js CHANGED
@@ -1,20 +1,4 @@
1
- import { createRequire } from "node:module";
2
- var __create = Object.create;
3
- var __getProtoOf = Object.getPrototypeOf;
4
1
  var __defProp = Object.defineProperty;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __toESM = (mod, isNodeMode, target) => {
8
- target = mod != null ? __create(__getProtoOf(mod)) : {};
9
- const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
10
- for (let key of __getOwnPropNames(mod))
11
- if (!__hasOwnProp.call(to, key))
12
- __defProp(to, key, {
13
- get: () => mod[key],
14
- enumerable: true
15
- });
16
- return to;
17
- };
18
2
  var __export = (target, all) => {
19
3
  for (var name in all)
20
4
  __defProp(target, name, {
@@ -24,7 +8,417 @@ var __export = (target, all) => {
24
8
  set: (newValue) => all[name] = () => newValue
25
9
  });
26
10
  };
27
- var __require = /* @__PURE__ */ createRequire(import.meta.url);
11
+ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
12
+
13
+ // node:util
14
+ var exports_util = {};
15
+ __export(exports_util, {
16
+ types: () => types,
17
+ promisify: () => promisify,
18
+ log: () => log,
19
+ isUndefined: () => isUndefined,
20
+ isSymbol: () => isSymbol,
21
+ isString: () => isString,
22
+ isRegExp: () => isRegExp,
23
+ isPrimitive: () => isPrimitive,
24
+ isObject: () => isObject,
25
+ isNumber: () => isNumber,
26
+ isNullOrUndefined: () => isNullOrUndefined,
27
+ isNull: () => isNull,
28
+ isFunction: () => isFunction,
29
+ isError: () => isError,
30
+ isDate: () => isDate,
31
+ isBuffer: () => isBuffer,
32
+ isBoolean: () => isBoolean,
33
+ isArray: () => isArray,
34
+ inspect: () => inspect,
35
+ inherits: () => inherits,
36
+ format: () => format,
37
+ deprecate: () => deprecate,
38
+ default: () => util_default,
39
+ debuglog: () => debuglog,
40
+ callbackifyOnRejected: () => callbackifyOnRejected,
41
+ callbackify: () => callbackify,
42
+ _extend: () => _extend,
43
+ TextEncoder: () => TextEncoder,
44
+ TextDecoder: () => TextDecoder
45
+ });
46
+ function format(f, ...args) {
47
+ if (!isString(f)) {
48
+ var objects = [f];
49
+ for (var i = 0;i < args.length; i++)
50
+ objects.push(inspect(args[i]));
51
+ return objects.join(" ");
52
+ }
53
+ var i = 0, len = args.length, str = String(f).replace(formatRegExp, function(x2) {
54
+ if (x2 === "%%")
55
+ return "%";
56
+ if (i >= len)
57
+ return x2;
58
+ switch (x2) {
59
+ case "%s":
60
+ return String(args[i++]);
61
+ case "%d":
62
+ return Number(args[i++]);
63
+ case "%j":
64
+ try {
65
+ return JSON.stringify(args[i++]);
66
+ } catch (_) {
67
+ return "[Circular]";
68
+ }
69
+ default:
70
+ return x2;
71
+ }
72
+ });
73
+ for (var x = args[i];i < len; x = args[++i])
74
+ if (isNull(x) || !isObject(x))
75
+ str += " " + x;
76
+ else
77
+ str += " " + inspect(x);
78
+ return str;
79
+ }
80
+ function deprecate(fn, msg) {
81
+ if (typeof process > "u" || process?.noDeprecation === true)
82
+ return fn;
83
+ var warned = false;
84
+ function deprecated(...args) {
85
+ if (!warned) {
86
+ if (process.throwDeprecation)
87
+ throw Error(msg);
88
+ else if (process.traceDeprecation)
89
+ console.trace(msg);
90
+ else
91
+ console.error(msg);
92
+ warned = true;
93
+ }
94
+ return fn.apply(this, ...args);
95
+ }
96
+ return deprecated;
97
+ }
98
+ function stylizeWithColor(str, styleType) {
99
+ var style = inspect.styles[styleType];
100
+ if (style)
101
+ return "\x1B[" + inspect.colors[style][0] + "m" + str + "\x1B[" + inspect.colors[style][1] + "m";
102
+ else
103
+ return str;
104
+ }
105
+ function stylizeNoColor(str, styleType) {
106
+ return str;
107
+ }
108
+ function arrayToHash(array) {
109
+ var hash = {};
110
+ return array.forEach(function(val, idx) {
111
+ hash[val] = true;
112
+ }), hash;
113
+ }
114
+ function formatValue(ctx, value, recurseTimes) {
115
+ if (ctx.customInspect && value && isFunction(value.inspect) && value.inspect !== inspect && !(value.constructor && value.constructor.prototype === value)) {
116
+ var ret = value.inspect(recurseTimes, ctx);
117
+ if (!isString(ret))
118
+ ret = formatValue(ctx, ret, recurseTimes);
119
+ return ret;
120
+ }
121
+ var primitive = formatPrimitive(ctx, value);
122
+ if (primitive)
123
+ return primitive;
124
+ var keys = Object.keys(value), visibleKeys = arrayToHash(keys);
125
+ if (ctx.showHidden)
126
+ keys = Object.getOwnPropertyNames(value);
127
+ if (isError(value) && (keys.indexOf("message") >= 0 || keys.indexOf("description") >= 0))
128
+ return formatError(value);
129
+ if (keys.length === 0) {
130
+ if (isFunction(value)) {
131
+ var name = value.name ? ": " + value.name : "";
132
+ return ctx.stylize("[Function" + name + "]", "special");
133
+ }
134
+ if (isRegExp(value))
135
+ return ctx.stylize(RegExp.prototype.toString.call(value), "regexp");
136
+ if (isDate(value))
137
+ return ctx.stylize(Date.prototype.toString.call(value), "date");
138
+ if (isError(value))
139
+ return formatError(value);
140
+ }
141
+ var base = "", array = false, braces = ["{", "}"];
142
+ if (isArray(value))
143
+ array = true, braces = ["[", "]"];
144
+ if (isFunction(value)) {
145
+ var n = value.name ? ": " + value.name : "";
146
+ base = " [Function" + n + "]";
147
+ }
148
+ if (isRegExp(value))
149
+ base = " " + RegExp.prototype.toString.call(value);
150
+ if (isDate(value))
151
+ base = " " + Date.prototype.toUTCString.call(value);
152
+ if (isError(value))
153
+ base = " " + formatError(value);
154
+ if (keys.length === 0 && (!array || value.length == 0))
155
+ return braces[0] + base + braces[1];
156
+ if (recurseTimes < 0)
157
+ if (isRegExp(value))
158
+ return ctx.stylize(RegExp.prototype.toString.call(value), "regexp");
159
+ else
160
+ return ctx.stylize("[Object]", "special");
161
+ ctx.seen.push(value);
162
+ var output;
163
+ if (array)
164
+ output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
165
+ else
166
+ output = keys.map(function(key) {
167
+ return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
168
+ });
169
+ return ctx.seen.pop(), reduceToSingleString(output, base, braces);
170
+ }
171
+ function formatPrimitive(ctx, value) {
172
+ if (isUndefined(value))
173
+ return ctx.stylize("undefined", "undefined");
174
+ if (isString(value)) {
175
+ var simple = "'" + JSON.stringify(value).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
176
+ return ctx.stylize(simple, "string");
177
+ }
178
+ if (isNumber(value))
179
+ return ctx.stylize("" + value, "number");
180
+ if (isBoolean(value))
181
+ return ctx.stylize("" + value, "boolean");
182
+ if (isNull(value))
183
+ return ctx.stylize("null", "null");
184
+ }
185
+ function formatError(value) {
186
+ return "[" + Error.prototype.toString.call(value) + "]";
187
+ }
188
+ function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
189
+ var output = [];
190
+ for (var i = 0, l = value.length;i < l; ++i)
191
+ if (hasOwnProperty(value, String(i)))
192
+ output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), true));
193
+ else
194
+ output.push("");
195
+ return keys.forEach(function(key) {
196
+ if (!key.match(/^\d+$/))
197
+ output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, true));
198
+ }), output;
199
+ }
200
+ function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
201
+ var name, str, desc;
202
+ if (desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }, desc.get)
203
+ if (desc.set)
204
+ str = ctx.stylize("[Getter/Setter]", "special");
205
+ else
206
+ str = ctx.stylize("[Getter]", "special");
207
+ else if (desc.set)
208
+ str = ctx.stylize("[Setter]", "special");
209
+ if (!hasOwnProperty(visibleKeys, key))
210
+ name = "[" + key + "]";
211
+ if (!str)
212
+ if (ctx.seen.indexOf(desc.value) < 0) {
213
+ if (isNull(recurseTimes))
214
+ str = formatValue(ctx, desc.value, null);
215
+ else
216
+ str = formatValue(ctx, desc.value, recurseTimes - 1);
217
+ if (str.indexOf(`
218
+ `) > -1)
219
+ if (array)
220
+ str = str.split(`
221
+ `).map(function(line) {
222
+ return " " + line;
223
+ }).join(`
224
+ `).slice(2);
225
+ else
226
+ str = `
227
+ ` + str.split(`
228
+ `).map(function(line) {
229
+ return " " + line;
230
+ }).join(`
231
+ `);
232
+ } else
233
+ str = ctx.stylize("[Circular]", "special");
234
+ if (isUndefined(name)) {
235
+ if (array && key.match(/^\d+$/))
236
+ return str;
237
+ if (name = JSON.stringify("" + key), name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/))
238
+ name = name.slice(1, -1), name = ctx.stylize(name, "name");
239
+ else
240
+ name = name.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"), name = ctx.stylize(name, "string");
241
+ }
242
+ return name + ": " + str;
243
+ }
244
+ function reduceToSingleString(output, base, braces) {
245
+ var numLinesEst = 0, length = output.reduce(function(prev, cur) {
246
+ if (numLinesEst++, cur.indexOf(`
247
+ `) >= 0)
248
+ numLinesEst++;
249
+ return prev + cur.replace(/\u001b\[\d\d?m/g, "").length + 1;
250
+ }, 0);
251
+ if (length > 60)
252
+ return braces[0] + (base === "" ? "" : base + `
253
+ `) + " " + output.join(`,
254
+ `) + " " + braces[1];
255
+ return braces[0] + base + " " + output.join(", ") + " " + braces[1];
256
+ }
257
+ function isArray(ar) {
258
+ return Array.isArray(ar);
259
+ }
260
+ function isBoolean(arg) {
261
+ return typeof arg === "boolean";
262
+ }
263
+ function isNull(arg) {
264
+ return arg === null;
265
+ }
266
+ function isNullOrUndefined(arg) {
267
+ return arg == null;
268
+ }
269
+ function isNumber(arg) {
270
+ return typeof arg === "number";
271
+ }
272
+ function isString(arg) {
273
+ return typeof arg === "string";
274
+ }
275
+ function isSymbol(arg) {
276
+ return typeof arg === "symbol";
277
+ }
278
+ function isUndefined(arg) {
279
+ return arg === undefined;
280
+ }
281
+ function isRegExp(re) {
282
+ return isObject(re) && objectToString(re) === "[object RegExp]";
283
+ }
284
+ function isObject(arg) {
285
+ return typeof arg === "object" && arg !== null;
286
+ }
287
+ function isDate(d) {
288
+ return isObject(d) && objectToString(d) === "[object Date]";
289
+ }
290
+ function isError(e) {
291
+ return isObject(e) && (objectToString(e) === "[object Error]" || e instanceof Error);
292
+ }
293
+ function isFunction(arg) {
294
+ return typeof arg === "function";
295
+ }
296
+ function isPrimitive(arg) {
297
+ return arg === null || typeof arg === "boolean" || typeof arg === "number" || typeof arg === "string" || typeof arg === "symbol" || typeof arg > "u";
298
+ }
299
+ function isBuffer(arg) {
300
+ return arg instanceof Buffer;
301
+ }
302
+ function objectToString(o) {
303
+ return Object.prototype.toString.call(o);
304
+ }
305
+ function pad(n) {
306
+ return n < 10 ? "0" + n.toString(10) : n.toString(10);
307
+ }
308
+ function timestamp() {
309
+ var d = new Date, time = [pad(d.getHours()), pad(d.getMinutes()), pad(d.getSeconds())].join(":");
310
+ return [d.getDate(), months[d.getMonth()], time].join(" ");
311
+ }
312
+ function log(...args) {
313
+ console.log("%s - %s", timestamp(), format.apply(null, args));
314
+ }
315
+ function inherits(ctor, superCtor) {
316
+ if (superCtor)
317
+ ctor.super_ = superCtor, ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: false, writable: true, configurable: true } });
318
+ }
319
+ function _extend(origin, add) {
320
+ if (!add || !isObject(add))
321
+ return origin;
322
+ var keys = Object.keys(add), i = keys.length;
323
+ while (i--)
324
+ origin[keys[i]] = add[keys[i]];
325
+ return origin;
326
+ }
327
+ function hasOwnProperty(obj, prop) {
328
+ return Object.prototype.hasOwnProperty.call(obj, prop);
329
+ }
330
+ function callbackifyOnRejected(reason, cb) {
331
+ if (!reason) {
332
+ var newReason = Error("Promise was rejected with a falsy value");
333
+ newReason.reason = reason, reason = newReason;
334
+ }
335
+ return cb(reason);
336
+ }
337
+ function callbackify(original) {
338
+ if (typeof original !== "function")
339
+ throw TypeError('The "original" argument must be of type Function');
340
+ function callbackified(...args) {
341
+ var maybeCb = args.pop();
342
+ if (typeof maybeCb !== "function")
343
+ throw TypeError("The last argument must be of type Function");
344
+ var self = this, cb = function(...args2) {
345
+ return maybeCb.apply(self, ...args2);
346
+ };
347
+ original.apply(this, args).then(function(ret) {
348
+ process.nextTick(cb.bind(null, null, ret));
349
+ }, function(rej) {
350
+ process.nextTick(callbackifyOnRejected.bind(null, rej, cb));
351
+ });
352
+ }
353
+ return Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original)), Object.defineProperties(callbackified, Object.getOwnPropertyDescriptors(original)), callbackified;
354
+ }
355
+ var formatRegExp, debuglog, inspect, types = () => {}, months, promisify, TextEncoder, TextDecoder, util_default;
356
+ var init_util = __esm(() => {
357
+ formatRegExp = /%[sdj%]/g;
358
+ debuglog = ((debugs = {}, debugEnvRegex = {}, debugEnv) => ((debugEnv = typeof process < "u" && false) && (debugEnv = debugEnv.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".*").replace(/,/g, "$|^").toUpperCase()), debugEnvRegex = new RegExp("^" + debugEnv + "$", "i"), (set) => {
359
+ if (set = set.toUpperCase(), !debugs[set])
360
+ if (debugEnvRegex.test(set))
361
+ debugs[set] = function(...args) {
362
+ console.error("%s: %s", set, pid, format.apply(null, ...args));
363
+ };
364
+ else
365
+ debugs[set] = function() {};
366
+ return debugs[set];
367
+ }))();
368
+ inspect = ((i) => (i.colors = { bold: [1, 22], italic: [3, 23], underline: [4, 24], inverse: [7, 27], white: [37, 39], grey: [90, 39], black: [30, 39], blue: [34, 39], cyan: [36, 39], green: [32, 39], magenta: [35, 39], red: [31, 39], yellow: [33, 39] }, i.styles = { special: "cyan", number: "yellow", boolean: "yellow", undefined: "grey", null: "bold", string: "green", date: "magenta", regexp: "red" }, i.custom = Symbol.for("nodejs.util.inspect.custom"), i))(function(obj, opts, ...rest) {
369
+ var ctx = { seen: [], stylize: stylizeNoColor };
370
+ if (rest.length >= 1)
371
+ ctx.depth = rest[0];
372
+ if (rest.length >= 2)
373
+ ctx.colors = rest[1];
374
+ if (isBoolean(opts))
375
+ ctx.showHidden = opts;
376
+ else if (opts)
377
+ _extend(ctx, opts);
378
+ if (isUndefined(ctx.showHidden))
379
+ ctx.showHidden = false;
380
+ if (isUndefined(ctx.depth))
381
+ ctx.depth = 2;
382
+ if (isUndefined(ctx.colors))
383
+ ctx.colors = false;
384
+ if (ctx.colors)
385
+ ctx.stylize = stylizeWithColor;
386
+ return formatValue(ctx, obj, ctx.depth);
387
+ });
388
+ months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
389
+ promisify = ((x) => (x.custom = Symbol.for("nodejs.util.promisify.custom"), x))(function(original) {
390
+ if (typeof original !== "function")
391
+ throw TypeError('The "original" argument must be of type Function');
392
+ if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {
393
+ var fn = original[kCustomPromisifiedSymbol];
394
+ if (typeof fn !== "function")
395
+ throw TypeError('The "nodejs.util.promisify.custom" argument must be of type Function');
396
+ return Object.defineProperty(fn, kCustomPromisifiedSymbol, { value: fn, enumerable: false, writable: false, configurable: true }), fn;
397
+ }
398
+ function fn(...args) {
399
+ var promiseResolve, promiseReject, promise = new Promise(function(resolve, reject) {
400
+ promiseResolve = resolve, promiseReject = reject;
401
+ });
402
+ args.push(function(err, value) {
403
+ if (err)
404
+ promiseReject(err);
405
+ else
406
+ promiseResolve(value);
407
+ });
408
+ try {
409
+ original.apply(this, args);
410
+ } catch (err) {
411
+ promiseReject(err);
412
+ }
413
+ return promise;
414
+ }
415
+ if (Object.setPrototypeOf(fn, Object.getPrototypeOf(original)), kCustomPromisifiedSymbol)
416
+ Object.defineProperty(fn, kCustomPromisifiedSymbol, { value: fn, enumerable: false, writable: false, configurable: true });
417
+ return Object.defineProperties(fn, Object.getOwnPropertyDescriptors(original));
418
+ });
419
+ ({ TextEncoder, TextDecoder } = globalThis);
420
+ util_default = { TextEncoder, TextDecoder, promisify, log, inherits, _extend, callbackifyOnRejected, callbackify };
421
+ });
28
422
 
29
423
  // ../../internal/constants/src/endpoints.ts
30
424
  var DEFAULT_PLATFORM = "BEYOND_AI";
@@ -180,7 +574,7 @@ function detectEnvironment() {
180
574
  var nodeInspect;
181
575
  if (!isBrowser()) {
182
576
  try {
183
- const util = await import("node:util");
577
+ const util = await Promise.resolve().then(() => (init_util(), exports_util));
184
578
  nodeInspect = util.inspect;
185
579
  } catch {}
186
580
  }
@@ -233,10 +627,10 @@ var terminalFormatter = (entry) => {
233
627
  const consoleMethod = getConsoleMethod(entry.level);
234
628
  const levelUpper = entry.level.toUpperCase().padEnd(5);
235
629
  const isoString = entry.timestamp.toISOString().replace(/\.\d{3}Z$/, "");
236
- const timestamp = `${colors.dim}[${isoString}]${colors.reset}`;
630
+ const timestamp2 = `${colors.dim}[${isoString}]${colors.reset}`;
237
631
  const level = `${levelColor}${levelUpper}${colors.reset}`;
238
632
  const scope = entry.scope ? `${colors.bold}[${entry.scope}]${colors.reset} ` : "";
239
- const prefix = `${timestamp} ${level} ${scope}${entry.message}`;
633
+ const prefix = `${timestamp2} ${level} ${scope}${entry.message}`;
240
634
  if (entry.context && Object.keys(entry.context).length > 0) {
241
635
  consoleMethod(prefix, formatContext(entry.context));
242
636
  } else {
@@ -251,9 +645,9 @@ var LEVEL_PREFIX = {
251
645
  error: "[ERROR]"
252
646
  };
253
647
  function formatContext2(context) {
254
- return Object.entries(context).map(([key, value]) => `${key}=${formatValue(value)}`).join(" ");
648
+ return Object.entries(context).map(([key, value]) => `${key}=${formatValue2(value)}`).join(" ");
255
649
  }
256
- function formatValue(value) {
650
+ function formatValue2(value) {
257
651
  if (typeof value === "string")
258
652
  return value;
259
653
  if (typeof value === "number")
@@ -413,7 +807,7 @@ function isDebug() {
413
807
  return false;
414
808
  }
415
809
  }
416
- var log = createLogger({ scope: "auth", minLevel: isDebug() ? "debug" : "warn" });
810
+ var log2 = createLogger({ scope: "auth", minLevel: isDebug() ? "debug" : "warn" });
417
811
 
418
812
  class TokenManager {
419
813
  config;
@@ -427,11 +821,11 @@ class TokenManager {
427
821
  }
428
822
  async getToken() {
429
823
  if (this.accessToken && Date.now() < this.tokenExpiry) {
430
- log.debug("Using cached token");
824
+ log2.debug("Using cached token");
431
825
  return this.accessToken;
432
826
  }
433
827
  if (this.pendingRequest) {
434
- log.debug("Waiting for in-flight token request");
828
+ log2.debug("Waiting for in-flight token request");
435
829
  return this.pendingRequest;
436
830
  }
437
831
  this.pendingRequest = this.fetchToken();
@@ -442,7 +836,7 @@ class TokenManager {
442
836
  }
443
837
  }
444
838
  async fetchToken() {
445
- log.debug("Fetching new access token...");
839
+ log2.debug("Fetching new access token...");
446
840
  const { clientId, clientSecret } = this.config.credentials;
447
841
  const credentials = btoa(`${clientId}:${clientSecret}`);
448
842
  const start = performance.now();
@@ -456,17 +850,17 @@ class TokenManager {
456
850
  });
457
851
  const duration = Math.round(performance.now() - start);
458
852
  if (!response.ok) {
459
- log.error(`Token request failed: ${response.status} ${response.statusText}`);
853
+ log2.error(`Token request failed: ${response.status} ${response.statusText}`);
460
854
  throw new Error(`Failed to obtain access token: ${response.status} ${response.statusText}`);
461
855
  }
462
856
  const data = await response.json();
463
857
  this.accessToken = data.access_token;
464
858
  this.tokenExpiry = Date.now() + (data.expires_in - 60) * 1000;
465
- log.debug(`Token acquired (${duration}ms, expires in ${data.expires_in}s)`);
859
+ log2.debug(`Token acquired (${duration}ms, expires in ${data.expires_in}s)`);
466
860
  return this.accessToken;
467
861
  }
468
862
  invalidate() {
469
- log.debug("Token invalidated");
863
+ log2.debug("Token invalidated");
470
864
  this.accessToken = null;
471
865
  this.tokenExpiry = 0;
472
866
  }
@@ -704,7 +1098,17 @@ class TimebackProvider {
704
1098
  // ../../internal/client-infra/src/utils/utils.ts
705
1099
  function getEnv(key) {
706
1100
  try {
707
- return typeof process === "undefined" ? undefined : process.env[key];
1101
+ if (typeof process === "undefined")
1102
+ return;
1103
+ if (typeof key === "string") {
1104
+ return process.env[key];
1105
+ }
1106
+ for (const k of key) {
1107
+ const value = process.env[k];
1108
+ if (value !== undefined)
1109
+ return value;
1110
+ }
1111
+ return;
708
1112
  } catch {
709
1113
  return;
710
1114
  }
@@ -738,6 +1142,18 @@ var DEFAULT_PROVIDER_REGISTRY = {
738
1142
  };
739
1143
 
740
1144
  // ../../internal/client-infra/src/config/resolve.ts
1145
+ function primaryEnvVar(key) {
1146
+ if (typeof key === "string") {
1147
+ return key;
1148
+ }
1149
+ if (key.length === 0) {
1150
+ throw new Error(`Missing env var key: ${key}`);
1151
+ }
1152
+ return key[0];
1153
+ }
1154
+ function formatEnvVarKey(key) {
1155
+ return primaryEnvVar(key);
1156
+ }
741
1157
  function validateEnv(env) {
742
1158
  if (env !== "staging" && env !== "production") {
743
1159
  throw new Error(`Invalid env "${env}": must be "staging" or "production"`);
@@ -748,10 +1164,10 @@ function validateAuth(auth, envVars) {
748
1164
  const clientId = auth?.clientId ?? getEnv(envVars.clientId);
749
1165
  const clientSecret = auth?.clientSecret ?? getEnv(envVars.clientSecret);
750
1166
  if (!clientId) {
751
- throw new Error(`Missing clientId: provide in config or set ${envVars.clientId}`);
1167
+ throw new Error(`Missing clientId: provide in config or set ${formatEnvVarKey(envVars.clientId)}`);
752
1168
  }
753
1169
  if (!clientSecret) {
754
- throw new Error(`Missing clientSecret: provide in config or set ${envVars.clientSecret}`);
1170
+ throw new Error(`Missing clientSecret: provide in config or set ${formatEnvVarKey(envVars.clientSecret)}`);
755
1171
  }
756
1172
  return { clientId, clientSecret };
757
1173
  }
@@ -767,21 +1183,21 @@ function buildMissingEnvError(envVars) {
767
1183
  const clientId = getEnv(envVars.clientId);
768
1184
  const clientSecret = getEnv(envVars.clientSecret);
769
1185
  if (baseUrl === undefined && clientId === undefined) {
770
- const hint = envVars.env ?? envVars.baseUrl;
1186
+ const hint = formatEnvVarKey(envVars.env ?? envVars.baseUrl);
771
1187
  return `Missing env: provide in config or set ${hint}`;
772
1188
  }
773
1189
  const missing = [];
774
1190
  if (baseUrl === undefined) {
775
- missing.push(envVars.env ?? envVars.baseUrl);
1191
+ missing.push(formatEnvVarKey(envVars.env ?? envVars.baseUrl));
776
1192
  }
777
1193
  if (baseUrl !== undefined && authUrl === undefined) {
778
- missing.push(envVars.authUrl);
1194
+ missing.push(formatEnvVarKey(envVars.authUrl));
779
1195
  }
780
1196
  if (clientId === undefined) {
781
- missing.push(envVars.clientId);
1197
+ missing.push(formatEnvVarKey(envVars.clientId));
782
1198
  }
783
1199
  if (clientSecret === undefined) {
784
- missing.push(envVars.clientSecret);
1200
+ missing.push(formatEnvVarKey(envVars.clientSecret));
785
1201
  }
786
1202
  return `Missing environment variables: ${missing.join(", ")}`;
787
1203
  }
@@ -1257,43 +1673,43 @@ function escapeValue(value) {
1257
1673
  }
1258
1674
  return value.replaceAll("'", "''");
1259
1675
  }
1260
- function formatValue2(value) {
1676
+ function formatValue3(value) {
1261
1677
  const escaped = escapeValue(value);
1262
1678
  const needsQuotes = typeof value === "string" || value instanceof Date;
1263
1679
  return needsQuotes ? `'${escaped}'` : escaped;
1264
1680
  }
1265
1681
  function fieldToConditions(field, condition) {
1266
1682
  if (typeof condition === "string" || typeof condition === "number" || typeof condition === "boolean" || condition instanceof Date) {
1267
- return [`${field}=${formatValue2(condition)}`];
1683
+ return [`${field}=${formatValue3(condition)}`];
1268
1684
  }
1269
1685
  if (typeof condition === "object" && condition !== null) {
1270
1686
  const ops = condition;
1271
1687
  const conditions = [];
1272
1688
  if (ops.ne !== undefined) {
1273
- conditions.push(`${field}!=${formatValue2(ops.ne)}`);
1689
+ conditions.push(`${field}!=${formatValue3(ops.ne)}`);
1274
1690
  }
1275
1691
  if (ops.gt !== undefined) {
1276
- conditions.push(`${field}>${formatValue2(ops.gt)}`);
1692
+ conditions.push(`${field}>${formatValue3(ops.gt)}`);
1277
1693
  }
1278
1694
  if (ops.gte !== undefined) {
1279
- conditions.push(`${field}>=${formatValue2(ops.gte)}`);
1695
+ conditions.push(`${field}>=${formatValue3(ops.gte)}`);
1280
1696
  }
1281
1697
  if (ops.lt !== undefined) {
1282
- conditions.push(`${field}<${formatValue2(ops.lt)}`);
1698
+ conditions.push(`${field}<${formatValue3(ops.lt)}`);
1283
1699
  }
1284
1700
  if (ops.lte !== undefined) {
1285
- conditions.push(`${field}<=${formatValue2(ops.lte)}`);
1701
+ conditions.push(`${field}<=${formatValue3(ops.lte)}`);
1286
1702
  }
1287
1703
  if (ops.contains !== undefined) {
1288
- conditions.push(`${field}~${formatValue2(ops.contains)}`);
1704
+ conditions.push(`${field}~${formatValue3(ops.contains)}`);
1289
1705
  }
1290
1706
  if (ops.in !== undefined && ops.in.length > 0) {
1291
- const inConditions = ops.in.map((v) => `${field}=${formatValue2(v)}`);
1707
+ const inConditions = ops.in.map((v) => `${field}=${formatValue3(v)}`);
1292
1708
  const joined = inConditions.join(" OR ");
1293
1709
  conditions.push(inConditions.length > 1 ? `(${joined})` : joined);
1294
1710
  }
1295
1711
  if (ops.notIn !== undefined && ops.notIn.length > 0) {
1296
- const notInConditions = ops.notIn.map((v) => `${field}!=${formatValue2(v)}`);
1712
+ const notInConditions = ops.notIn.map((v) => `${field}!=${formatValue3(v)}`);
1297
1713
  conditions.push(notInConditions.join(" AND "));
1298
1714
  }
1299
1715
  return conditions;
@@ -1504,10 +1920,10 @@ function validateSourcedId(sourcedId, context) {
1504
1920
  }
1505
1921
  // src/constants.ts
1506
1922
  var ONEROSTER_ENV_VARS = {
1507
- baseUrl: "ONEROSTER_BASE_URL",
1508
- clientId: "ONEROSTER_CLIENT_ID",
1509
- clientSecret: "ONEROSTER_CLIENT_SECRET",
1510
- authUrl: "ONEROSTER_TOKEN_URL"
1923
+ baseUrl: ["TIMEBACK_API_BASE_URL", "TIMEBACK_BASE_URL", "ONEROSTER_BASE_URL"],
1924
+ clientId: ["TIMEBACK_API_CLIENT_ID", "TIMEBACK_CLIENT_ID", "ONEROSTER_CLIENT_ID"],
1925
+ clientSecret: ["TIMEBACK_API_CLIENT_SECRET", "TIMEBACK_CLIENT_SECRET", "ONEROSTER_CLIENT_SECRET"],
1926
+ authUrl: ["TIMEBACK_API_AUTH_URL", "TIMEBACK_AUTH_URL", "ONEROSTER_TOKEN_URL"]
1511
1927
  };
1512
1928
 
1513
1929
  // src/lib/resolve.ts
@@ -1516,7 +1932,7 @@ function resolveToProvider2(config, registry = DEFAULT_PROVIDER_REGISTRY) {
1516
1932
  }
1517
1933
 
1518
1934
  // src/utils.ts
1519
- var log2 = createScopedLogger("oneroster");
1935
+ var log3 = createScopedLogger("oneroster");
1520
1936
  function parseGrades(grades) {
1521
1937
  if (!grades)
1522
1938
  return;
@@ -1535,7 +1951,7 @@ function normalizeBoolean(value) {
1535
1951
  class Transport extends BaseTransport {
1536
1952
  paths;
1537
1953
  constructor(config) {
1538
- super({ config, logger: log2 });
1954
+ super({ config, logger: log3 });
1539
1955
  this.paths = config.paths;
1540
1956
  }
1541
1957
  async requestPaginated(path, options = {}) {
@@ -1555,7 +1971,7 @@ __export(exports_external, {
1555
1971
  uuidv6: () => uuidv6,
1556
1972
  uuidv4: () => uuidv4,
1557
1973
  uuid: () => uuid2,
1558
- util: () => exports_util,
1974
+ util: () => exports_util2,
1559
1975
  url: () => url,
1560
1976
  uppercase: () => _uppercase,
1561
1977
  unknown: () => unknown,
@@ -1664,7 +2080,7 @@ __export(exports_external, {
1664
2080
  getErrorMap: () => getErrorMap,
1665
2081
  function: () => _function,
1666
2082
  fromJSONSchema: () => fromJSONSchema,
1667
- formatError: () => formatError,
2083
+ formatError: () => formatError2,
1668
2084
  float64: () => float64,
1669
2085
  float32: () => float32,
1670
2086
  flattenError: () => flattenError,
@@ -1790,7 +2206,7 @@ __export(exports_external, {
1790
2206
  var exports_core2 = {};
1791
2207
  __export(exports_core2, {
1792
2208
  version: () => version,
1793
- util: () => exports_util,
2209
+ util: () => exports_util2,
1794
2210
  treeifyError: () => treeifyError,
1795
2211
  toJSONSchema: () => toJSONSchema,
1796
2212
  toDotPath: () => toDotPath,
@@ -1814,7 +2230,7 @@ __export(exports_core2, {
1814
2230
  initializeContext: () => initializeContext,
1815
2231
  globalRegistry: () => globalRegistry,
1816
2232
  globalConfig: () => globalConfig,
1817
- formatError: () => formatError,
2233
+ formatError: () => formatError2,
1818
2234
  flattenError: () => flattenError,
1819
2235
  finalize: () => finalize,
1820
2236
  extractDefs: () => extractDefs,
@@ -2141,8 +2557,8 @@ function config(newConfig) {
2141
2557
  return globalConfig;
2142
2558
  }
2143
2559
  // ../../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/util.js
2144
- var exports_util = {};
2145
- __export(exports_util, {
2560
+ var exports_util2 = {};
2561
+ __export(exports_util2, {
2146
2562
  unwrapMessage: () => unwrapMessage,
2147
2563
  uint8ArrayToHex: () => uint8ArrayToHex,
2148
2564
  uint8ArrayToBase64url: () => uint8ArrayToBase64url,
@@ -2172,7 +2588,7 @@ __export(exports_util, {
2172
2588
  joinValues: () => joinValues,
2173
2589
  issue: () => issue2,
2174
2590
  isPlainObject: () => isPlainObject,
2175
- isObject: () => isObject,
2591
+ isObject: () => isObject2,
2176
2592
  hexToUint8Array: () => hexToUint8Array,
2177
2593
  getSizableOrigin: () => getSizableOrigin,
2178
2594
  getParsedType: () => getParsedType,
@@ -2341,7 +2757,7 @@ function slugify(input) {
2341
2757
  return input.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
2342
2758
  }
2343
2759
  var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {};
2344
- function isObject(data) {
2760
+ function isObject2(data) {
2345
2761
  return typeof data === "object" && data !== null && !Array.isArray(data);
2346
2762
  }
2347
2763
  var allowsEval = cached(() => {
@@ -2357,7 +2773,7 @@ var allowsEval = cached(() => {
2357
2773
  }
2358
2774
  });
2359
2775
  function isPlainObject(o) {
2360
- if (isObject(o) === false)
2776
+ if (isObject2(o) === false)
2361
2777
  return false;
2362
2778
  const ctor = o.constructor;
2363
2779
  if (ctor === undefined)
@@ -2365,7 +2781,7 @@ function isPlainObject(o) {
2365
2781
  if (typeof ctor !== "function")
2366
2782
  return true;
2367
2783
  const prot = ctor.prototype;
2368
- if (isObject(prot) === false)
2784
+ if (isObject2(prot) === false)
2369
2785
  return false;
2370
2786
  if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) {
2371
2787
  return false;
@@ -2846,7 +3262,7 @@ function flattenError(error, mapper = (issue3) => issue3.message) {
2846
3262
  }
2847
3263
  return { formErrors, fieldErrors };
2848
3264
  }
2849
- function formatError(error, mapper = (issue3) => issue3.message) {
3265
+ function formatError2(error, mapper = (issue3) => issue3.message) {
2850
3266
  const fieldErrors = { _errors: [] };
2851
3267
  const processError = (error2) => {
2852
3268
  for (const issue3 of error2.issues) {
@@ -4371,15 +4787,15 @@ var $ZodDate = /* @__PURE__ */ $constructor("$ZodDate", (inst, def) => {
4371
4787
  } catch (_err) {}
4372
4788
  }
4373
4789
  const input = payload.value;
4374
- const isDate = input instanceof Date;
4375
- const isValidDate = isDate && !Number.isNaN(input.getTime());
4790
+ const isDate2 = input instanceof Date;
4791
+ const isValidDate = isDate2 && !Number.isNaN(input.getTime());
4376
4792
  if (isValidDate)
4377
4793
  return payload;
4378
4794
  payload.issues.push({
4379
4795
  expected: "date",
4380
4796
  code: "invalid_type",
4381
4797
  input,
4382
- ...isDate ? { received: "Invalid Date" } : {},
4798
+ ...isDate2 ? { received: "Invalid Date" } : {},
4383
4799
  inst
4384
4800
  });
4385
4801
  return payload;
@@ -4518,13 +4934,13 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
4518
4934
  }
4519
4935
  return propValues;
4520
4936
  });
4521
- const isObject2 = isObject;
4937
+ const isObject3 = isObject2;
4522
4938
  const catchall = def.catchall;
4523
4939
  let value;
4524
4940
  inst._zod.parse = (payload, ctx) => {
4525
4941
  value ?? (value = _normalized.value);
4526
4942
  const input = payload.value;
4527
- if (!isObject2(input)) {
4943
+ if (!isObject3(input)) {
4528
4944
  payload.issues.push({
4529
4945
  expected: "object",
4530
4946
  code: "invalid_type",
@@ -4622,7 +5038,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
4622
5038
  return (payload, ctx) => fn(shape, payload, ctx);
4623
5039
  };
4624
5040
  let fastpass;
4625
- const isObject2 = isObject;
5041
+ const isObject3 = isObject2;
4626
5042
  const jit = !globalConfig.jitless;
4627
5043
  const allowsEval2 = allowsEval;
4628
5044
  const fastEnabled = jit && allowsEval2.value;
@@ -4631,7 +5047,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
4631
5047
  inst._zod.parse = (payload, ctx) => {
4632
5048
  value ?? (value = _normalized.value);
4633
5049
  const input = payload.value;
4634
- if (!isObject2(input)) {
5050
+ if (!isObject3(input)) {
4635
5051
  payload.issues.push({
4636
5052
  expected: "object",
4637
5053
  code: "invalid_type",
@@ -4809,7 +5225,7 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
4809
5225
  });
4810
5226
  inst._zod.parse = (payload, ctx) => {
4811
5227
  const input = payload.value;
4812
- if (!isObject(input)) {
5228
+ if (!isObject2(input)) {
4813
5229
  payload.issues.push({
4814
5230
  code: "invalid_type",
4815
5231
  expected: "object",
@@ -11903,10 +12319,10 @@ function _property(property, schema, params) {
11903
12319
  ...normalizeParams(params)
11904
12320
  });
11905
12321
  }
11906
- function _mime(types, params) {
12322
+ function _mime(types2, params) {
11907
12323
  return new $ZodCheckMimeType({
11908
12324
  check: "mime_type",
11909
- mime: types,
12325
+ mime: types2,
11910
12326
  ...normalizeParams(params)
11911
12327
  });
11912
12328
  }
@@ -12229,13 +12645,13 @@ function _stringbool(Classes, _params) {
12229
12645
  });
12230
12646
  return codec;
12231
12647
  }
12232
- function _stringFormat(Class2, format, fnOrRegex, _params = {}) {
12648
+ function _stringFormat(Class2, format2, fnOrRegex, _params = {}) {
12233
12649
  const params = normalizeParams(_params);
12234
12650
  const def = {
12235
12651
  ...normalizeParams(_params),
12236
12652
  check: "string_format",
12237
12653
  type: "string",
12238
- format,
12654
+ format: format2,
12239
12655
  fn: typeof fnOrRegex === "function" ? fnOrRegex : (val) => fnOrRegex.test(val),
12240
12656
  ...params
12241
12657
  };
@@ -12601,16 +13017,16 @@ var formatMap = {
12601
13017
  var stringProcessor = (schema, ctx, _json, _params) => {
12602
13018
  const json = _json;
12603
13019
  json.type = "string";
12604
- const { minimum, maximum, format, patterns: patterns2, contentEncoding } = schema._zod.bag;
13020
+ const { minimum, maximum, format: format2, patterns: patterns2, contentEncoding } = schema._zod.bag;
12605
13021
  if (typeof minimum === "number")
12606
13022
  json.minLength = minimum;
12607
13023
  if (typeof maximum === "number")
12608
13024
  json.maxLength = maximum;
12609
- if (format) {
12610
- json.format = formatMap[format] ?? format;
13025
+ if (format2) {
13026
+ json.format = formatMap[format2] ?? format2;
12611
13027
  if (json.format === "")
12612
13028
  delete json.format;
12613
- if (format === "time") {
13029
+ if (format2 === "time") {
12614
13030
  delete json.format;
12615
13031
  }
12616
13032
  }
@@ -12632,8 +13048,8 @@ var stringProcessor = (schema, ctx, _json, _params) => {
12632
13048
  };
12633
13049
  var numberProcessor = (schema, ctx, _json, _params) => {
12634
13050
  const json = _json;
12635
- const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
12636
- if (typeof format === "string" && format.includes("int"))
13051
+ const { minimum, maximum, format: format2, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
13052
+ if (typeof format2 === "string" && format2.includes("int"))
12637
13053
  json.type = "integer";
12638
13054
  else
12639
13055
  json.type = "number";
@@ -13446,7 +13862,7 @@ var initializer2 = (inst, issues) => {
13446
13862
  inst.name = "ZodError";
13447
13863
  Object.defineProperties(inst, {
13448
13864
  format: {
13449
- value: (mapper) => formatError(inst, mapper)
13865
+ value: (mapper) => formatError2(inst, mapper)
13450
13866
  },
13451
13867
  flatten: {
13452
13868
  value: (mapper) => flattenError(inst, mapper)
@@ -13503,7 +13919,7 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
13503
13919
  inst.type = def.type;
13504
13920
  Object.defineProperty(inst, "_def", { value: def });
13505
13921
  inst.check = (...checks2) => {
13506
- return inst.clone(exports_util.mergeDefs(def, {
13922
+ return inst.clone(exports_util2.mergeDefs(def, {
13507
13923
  checks: [
13508
13924
  ...def.checks ?? [],
13509
13925
  ...checks2.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch)
@@ -13676,7 +14092,7 @@ function httpUrl(params) {
13676
14092
  return _url(ZodURL, {
13677
14093
  protocol: /^https?$/,
13678
14094
  hostname: exports_regexes.domain,
13679
- ...exports_util.normalizeParams(params)
14095
+ ...exports_util2.normalizeParams(params)
13680
14096
  });
13681
14097
  }
13682
14098
  var ZodEmoji = /* @__PURE__ */ $constructor("ZodEmoji", (inst, def) => {
@@ -13795,8 +14211,8 @@ var ZodCustomStringFormat = /* @__PURE__ */ $constructor("ZodCustomStringFormat"
13795
14211
  $ZodCustomStringFormat.init(inst, def);
13796
14212
  ZodStringFormat.init(inst, def);
13797
14213
  });
13798
- function stringFormat(format, fnOrRegex, _params = {}) {
13799
- return _stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);
14214
+ function stringFormat(format2, fnOrRegex, _params = {}) {
14215
+ return _stringFormat(ZodCustomStringFormat, format2, fnOrRegex, _params);
13800
14216
  }
13801
14217
  function hostname2(_params) {
13802
14218
  return _stringFormat(ZodCustomStringFormat, "hostname", exports_regexes.hostname, _params);
@@ -13806,11 +14222,11 @@ function hex2(_params) {
13806
14222
  }
13807
14223
  function hash(alg, params) {
13808
14224
  const enc = params?.enc ?? "hex";
13809
- const format = `${alg}_${enc}`;
13810
- const regex = exports_regexes[format];
14225
+ const format2 = `${alg}_${enc}`;
14226
+ const regex = exports_regexes[format2];
13811
14227
  if (!regex)
13812
- throw new Error(`Unrecognized hash format: ${format}`);
13813
- return _stringFormat(ZodCustomStringFormat, format, regex, params);
14228
+ throw new Error(`Unrecognized hash format: ${format2}`);
14229
+ return _stringFormat(ZodCustomStringFormat, format2, regex, params);
13814
14230
  }
13815
14231
  var ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
13816
14232
  $ZodNumber.init(inst, def);
@@ -13994,7 +14410,7 @@ var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
13994
14410
  $ZodObjectJIT.init(inst, def);
13995
14411
  ZodType.init(inst, def);
13996
14412
  inst._zod.processJSONSchema = (ctx, json, params) => objectProcessor(inst, ctx, json, params);
13997
- exports_util.defineLazy(inst, "shape", () => {
14413
+ exports_util2.defineLazy(inst, "shape", () => {
13998
14414
  return def.shape;
13999
14415
  });
14000
14416
  inst.keyof = () => _enum2(Object.keys(inst._zod.def.shape));
@@ -14004,22 +14420,22 @@ var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
14004
14420
  inst.strict = () => inst.clone({ ...inst._zod.def, catchall: never() });
14005
14421
  inst.strip = () => inst.clone({ ...inst._zod.def, catchall: undefined });
14006
14422
  inst.extend = (incoming) => {
14007
- return exports_util.extend(inst, incoming);
14423
+ return exports_util2.extend(inst, incoming);
14008
14424
  };
14009
14425
  inst.safeExtend = (incoming) => {
14010
- return exports_util.safeExtend(inst, incoming);
14426
+ return exports_util2.safeExtend(inst, incoming);
14011
14427
  };
14012
- inst.merge = (other) => exports_util.merge(inst, other);
14013
- inst.pick = (mask) => exports_util.pick(inst, mask);
14014
- inst.omit = (mask) => exports_util.omit(inst, mask);
14015
- inst.partial = (...args) => exports_util.partial(ZodOptional, inst, args[0]);
14016
- inst.required = (...args) => exports_util.required(ZodNonOptional, inst, args[0]);
14428
+ inst.merge = (other) => exports_util2.merge(inst, other);
14429
+ inst.pick = (mask) => exports_util2.pick(inst, mask);
14430
+ inst.omit = (mask) => exports_util2.omit(inst, mask);
14431
+ inst.partial = (...args) => exports_util2.partial(ZodOptional, inst, args[0]);
14432
+ inst.required = (...args) => exports_util2.required(ZodNonOptional, inst, args[0]);
14017
14433
  });
14018
14434
  function object(shape, params) {
14019
14435
  const def = {
14020
14436
  type: "object",
14021
14437
  shape: shape ?? {},
14022
- ...exports_util.normalizeParams(params)
14438
+ ...exports_util2.normalizeParams(params)
14023
14439
  };
14024
14440
  return new ZodObject(def);
14025
14441
  }
@@ -14028,7 +14444,7 @@ function strictObject(shape, params) {
14028
14444
  type: "object",
14029
14445
  shape,
14030
14446
  catchall: never(),
14031
- ...exports_util.normalizeParams(params)
14447
+ ...exports_util2.normalizeParams(params)
14032
14448
  });
14033
14449
  }
14034
14450
  function looseObject(shape, params) {
@@ -14036,7 +14452,7 @@ function looseObject(shape, params) {
14036
14452
  type: "object",
14037
14453
  shape,
14038
14454
  catchall: unknown(),
14039
- ...exports_util.normalizeParams(params)
14455
+ ...exports_util2.normalizeParams(params)
14040
14456
  });
14041
14457
  }
14042
14458
  var ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => {
@@ -14049,7 +14465,7 @@ function union(options, params) {
14049
14465
  return new ZodUnion({
14050
14466
  type: "union",
14051
14467
  options,
14052
- ...exports_util.normalizeParams(params)
14468
+ ...exports_util2.normalizeParams(params)
14053
14469
  });
14054
14470
  }
14055
14471
  var ZodXor = /* @__PURE__ */ $constructor("ZodXor", (inst, def) => {
@@ -14063,7 +14479,7 @@ function xor(options, params) {
14063
14479
  type: "union",
14064
14480
  options,
14065
14481
  inclusive: false,
14066
- ...exports_util.normalizeParams(params)
14482
+ ...exports_util2.normalizeParams(params)
14067
14483
  });
14068
14484
  }
14069
14485
  var ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("ZodDiscriminatedUnion", (inst, def) => {
@@ -14075,7 +14491,7 @@ function discriminatedUnion(discriminator, options, params) {
14075
14491
  type: "union",
14076
14492
  options,
14077
14493
  discriminator,
14078
- ...exports_util.normalizeParams(params)
14494
+ ...exports_util2.normalizeParams(params)
14079
14495
  });
14080
14496
  }
14081
14497
  var ZodIntersection = /* @__PURE__ */ $constructor("ZodIntersection", (inst, def) => {
@@ -14107,7 +14523,7 @@ function tuple(items, _paramsOrRest, _params) {
14107
14523
  type: "tuple",
14108
14524
  items,
14109
14525
  rest,
14110
- ...exports_util.normalizeParams(params)
14526
+ ...exports_util2.normalizeParams(params)
14111
14527
  });
14112
14528
  }
14113
14529
  var ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => {
@@ -14122,7 +14538,7 @@ function record(keyType, valueType, params) {
14122
14538
  type: "record",
14123
14539
  keyType,
14124
14540
  valueType,
14125
- ...exports_util.normalizeParams(params)
14541
+ ...exports_util2.normalizeParams(params)
14126
14542
  });
14127
14543
  }
14128
14544
  function partialRecord(keyType, valueType, params) {
@@ -14132,7 +14548,7 @@ function partialRecord(keyType, valueType, params) {
14132
14548
  type: "record",
14133
14549
  keyType: k,
14134
14550
  valueType,
14135
- ...exports_util.normalizeParams(params)
14551
+ ...exports_util2.normalizeParams(params)
14136
14552
  });
14137
14553
  }
14138
14554
  function looseRecord(keyType, valueType, params) {
@@ -14141,7 +14557,7 @@ function looseRecord(keyType, valueType, params) {
14141
14557
  keyType,
14142
14558
  valueType,
14143
14559
  mode: "loose",
14144
- ...exports_util.normalizeParams(params)
14560
+ ...exports_util2.normalizeParams(params)
14145
14561
  });
14146
14562
  }
14147
14563
  var ZodMap = /* @__PURE__ */ $constructor("ZodMap", (inst, def) => {
@@ -14160,7 +14576,7 @@ function map(keyType, valueType, params) {
14160
14576
  type: "map",
14161
14577
  keyType,
14162
14578
  valueType,
14163
- ...exports_util.normalizeParams(params)
14579
+ ...exports_util2.normalizeParams(params)
14164
14580
  });
14165
14581
  }
14166
14582
  var ZodSet = /* @__PURE__ */ $constructor("ZodSet", (inst, def) => {
@@ -14176,7 +14592,7 @@ function set(valueType, params) {
14176
14592
  return new ZodSet({
14177
14593
  type: "set",
14178
14594
  valueType,
14179
- ...exports_util.normalizeParams(params)
14595
+ ...exports_util2.normalizeParams(params)
14180
14596
  });
14181
14597
  }
14182
14598
  var ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
@@ -14197,7 +14613,7 @@ var ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
14197
14613
  return new ZodEnum({
14198
14614
  ...def,
14199
14615
  checks: [],
14200
- ...exports_util.normalizeParams(params),
14616
+ ...exports_util2.normalizeParams(params),
14201
14617
  entries: newEntries
14202
14618
  });
14203
14619
  };
@@ -14212,7 +14628,7 @@ var ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
14212
14628
  return new ZodEnum({
14213
14629
  ...def,
14214
14630
  checks: [],
14215
- ...exports_util.normalizeParams(params),
14631
+ ...exports_util2.normalizeParams(params),
14216
14632
  entries: newEntries
14217
14633
  });
14218
14634
  };
@@ -14222,14 +14638,14 @@ function _enum2(values, params) {
14222
14638
  return new ZodEnum({
14223
14639
  type: "enum",
14224
14640
  entries,
14225
- ...exports_util.normalizeParams(params)
14641
+ ...exports_util2.normalizeParams(params)
14226
14642
  });
14227
14643
  }
14228
14644
  function nativeEnum(entries, params) {
14229
14645
  return new ZodEnum({
14230
14646
  type: "enum",
14231
14647
  entries,
14232
- ...exports_util.normalizeParams(params)
14648
+ ...exports_util2.normalizeParams(params)
14233
14649
  });
14234
14650
  }
14235
14651
  var ZodLiteral = /* @__PURE__ */ $constructor("ZodLiteral", (inst, def) => {
@@ -14250,7 +14666,7 @@ function literal(value, params) {
14250
14666
  return new ZodLiteral({
14251
14667
  type: "literal",
14252
14668
  values: Array.isArray(value) ? value : [value],
14253
- ...exports_util.normalizeParams(params)
14669
+ ...exports_util2.normalizeParams(params)
14254
14670
  });
14255
14671
  }
14256
14672
  var ZodFile = /* @__PURE__ */ $constructor("ZodFile", (inst, def) => {
@@ -14259,7 +14675,7 @@ var ZodFile = /* @__PURE__ */ $constructor("ZodFile", (inst, def) => {
14259
14675
  inst._zod.processJSONSchema = (ctx, json, params) => fileProcessor(inst, ctx, json, params);
14260
14676
  inst.min = (size, params) => inst.check(_minSize(size, params));
14261
14677
  inst.max = (size, params) => inst.check(_maxSize(size, params));
14262
- inst.mime = (types, params) => inst.check(_mime(Array.isArray(types) ? types : [types], params));
14678
+ inst.mime = (types2, params) => inst.check(_mime(Array.isArray(types2) ? types2 : [types2], params));
14263
14679
  });
14264
14680
  function file(params) {
14265
14681
  return _file(ZodFile, params);
@@ -14274,7 +14690,7 @@ var ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
14274
14690
  }
14275
14691
  payload.addIssue = (issue3) => {
14276
14692
  if (typeof issue3 === "string") {
14277
- payload.issues.push(exports_util.issue(issue3, payload.value, def));
14693
+ payload.issues.push(exports_util2.issue(issue3, payload.value, def));
14278
14694
  } else {
14279
14695
  const _issue = issue3;
14280
14696
  if (_issue.fatal)
@@ -14282,7 +14698,7 @@ var ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
14282
14698
  _issue.code ?? (_issue.code = "custom");
14283
14699
  _issue.input ?? (_issue.input = payload.value);
14284
14700
  _issue.inst ?? (_issue.inst = inst);
14285
- payload.issues.push(exports_util.issue(_issue));
14701
+ payload.issues.push(exports_util2.issue(_issue));
14286
14702
  }
14287
14703
  };
14288
14704
  const output = def.transform(payload.value, payload);
@@ -14353,7 +14769,7 @@ function _default2(innerType, defaultValue) {
14353
14769
  type: "default",
14354
14770
  innerType,
14355
14771
  get defaultValue() {
14356
- return typeof defaultValue === "function" ? defaultValue() : exports_util.shallowClone(defaultValue);
14772
+ return typeof defaultValue === "function" ? defaultValue() : exports_util2.shallowClone(defaultValue);
14357
14773
  }
14358
14774
  });
14359
14775
  }
@@ -14368,7 +14784,7 @@ function prefault(innerType, defaultValue) {
14368
14784
  type: "prefault",
14369
14785
  innerType,
14370
14786
  get defaultValue() {
14371
- return typeof defaultValue === "function" ? defaultValue() : exports_util.shallowClone(defaultValue);
14787
+ return typeof defaultValue === "function" ? defaultValue() : exports_util2.shallowClone(defaultValue);
14372
14788
  }
14373
14789
  });
14374
14790
  }
@@ -14382,7 +14798,7 @@ function nonoptional(innerType, params) {
14382
14798
  return new ZodNonOptional({
14383
14799
  type: "nonoptional",
14384
14800
  innerType,
14385
- ...exports_util.normalizeParams(params)
14801
+ ...exports_util2.normalizeParams(params)
14386
14802
  });
14387
14803
  }
14388
14804
  var ZodSuccess = /* @__PURE__ */ $constructor("ZodSuccess", (inst, def) => {
@@ -14467,7 +14883,7 @@ function templateLiteral(parts, params) {
14467
14883
  return new ZodTemplateLiteral({
14468
14884
  type: "template_literal",
14469
14885
  parts,
14470
- ...exports_util.normalizeParams(params)
14886
+ ...exports_util2.normalizeParams(params)
14471
14887
  });
14472
14888
  }
14473
14889
  var ZodLazy = /* @__PURE__ */ $constructor("ZodLazy", (inst, def) => {
@@ -14535,7 +14951,7 @@ function _instanceof(cls, params = {}) {
14535
14951
  check: "custom",
14536
14952
  fn: (data) => data instanceof cls,
14537
14953
  abort: true,
14538
- ...exports_util.normalizeParams(params)
14954
+ ...exports_util2.normalizeParams(params)
14539
14955
  });
14540
14956
  inst._zod.bag.Class = cls;
14541
14957
  inst._zod.check = (payload) => {
@@ -14769,52 +15185,52 @@ function convertBaseSchema(schema, ctx) {
14769
15185
  case "string": {
14770
15186
  let stringSchema = z.string();
14771
15187
  if (schema.format) {
14772
- const format = schema.format;
14773
- if (format === "email") {
15188
+ const format2 = schema.format;
15189
+ if (format2 === "email") {
14774
15190
  stringSchema = stringSchema.check(z.email());
14775
- } else if (format === "uri" || format === "uri-reference") {
15191
+ } else if (format2 === "uri" || format2 === "uri-reference") {
14776
15192
  stringSchema = stringSchema.check(z.url());
14777
- } else if (format === "uuid" || format === "guid") {
15193
+ } else if (format2 === "uuid" || format2 === "guid") {
14778
15194
  stringSchema = stringSchema.check(z.uuid());
14779
- } else if (format === "date-time") {
15195
+ } else if (format2 === "date-time") {
14780
15196
  stringSchema = stringSchema.check(z.iso.datetime());
14781
- } else if (format === "date") {
15197
+ } else if (format2 === "date") {
14782
15198
  stringSchema = stringSchema.check(z.iso.date());
14783
- } else if (format === "time") {
15199
+ } else if (format2 === "time") {
14784
15200
  stringSchema = stringSchema.check(z.iso.time());
14785
- } else if (format === "duration") {
15201
+ } else if (format2 === "duration") {
14786
15202
  stringSchema = stringSchema.check(z.iso.duration());
14787
- } else if (format === "ipv4") {
15203
+ } else if (format2 === "ipv4") {
14788
15204
  stringSchema = stringSchema.check(z.ipv4());
14789
- } else if (format === "ipv6") {
15205
+ } else if (format2 === "ipv6") {
14790
15206
  stringSchema = stringSchema.check(z.ipv6());
14791
- } else if (format === "mac") {
15207
+ } else if (format2 === "mac") {
14792
15208
  stringSchema = stringSchema.check(z.mac());
14793
- } else if (format === "cidr") {
15209
+ } else if (format2 === "cidr") {
14794
15210
  stringSchema = stringSchema.check(z.cidrv4());
14795
- } else if (format === "cidr-v6") {
15211
+ } else if (format2 === "cidr-v6") {
14796
15212
  stringSchema = stringSchema.check(z.cidrv6());
14797
- } else if (format === "base64") {
15213
+ } else if (format2 === "base64") {
14798
15214
  stringSchema = stringSchema.check(z.base64());
14799
- } else if (format === "base64url") {
15215
+ } else if (format2 === "base64url") {
14800
15216
  stringSchema = stringSchema.check(z.base64url());
14801
- } else if (format === "e164") {
15217
+ } else if (format2 === "e164") {
14802
15218
  stringSchema = stringSchema.check(z.e164());
14803
- } else if (format === "jwt") {
15219
+ } else if (format2 === "jwt") {
14804
15220
  stringSchema = stringSchema.check(z.jwt());
14805
- } else if (format === "emoji") {
15221
+ } else if (format2 === "emoji") {
14806
15222
  stringSchema = stringSchema.check(z.emoji());
14807
- } else if (format === "nanoid") {
15223
+ } else if (format2 === "nanoid") {
14808
15224
  stringSchema = stringSchema.check(z.nanoid());
14809
- } else if (format === "cuid") {
15225
+ } else if (format2 === "cuid") {
14810
15226
  stringSchema = stringSchema.check(z.cuid());
14811
- } else if (format === "cuid2") {
15227
+ } else if (format2 === "cuid2") {
14812
15228
  stringSchema = stringSchema.check(z.cuid2());
14813
- } else if (format === "ulid") {
15229
+ } else if (format2 === "ulid") {
14814
15230
  stringSchema = stringSchema.check(z.ulid());
14815
- } else if (format === "xid") {
15231
+ } else if (format2 === "xid") {
14816
15232
  stringSchema = stringSchema.check(z.xid());
14817
- } else if (format === "ksuid") {
15233
+ } else if (format2 === "ksuid") {
14818
15234
  stringSchema = stringSchema.check(z.ksuid());
14819
15235
  }
14820
15236
  }
@@ -15257,6 +15673,8 @@ var ActivityCompletedInput = exports_external.object({
15257
15673
  metricsId: exports_external.string().optional(),
15258
15674
  id: exports_external.string().optional(),
15259
15675
  extensions: exports_external.record(exports_external.string(), exports_external.unknown()).optional(),
15676
+ edApp: exports_external.union([exports_external.string(), exports_external.record(exports_external.string(), exports_external.unknown())]).optional(),
15677
+ session: exports_external.union([exports_external.string(), exports_external.record(exports_external.string(), exports_external.unknown())]).optional(),
15260
15678
  attempt: exports_external.number().int().min(1).optional(),
15261
15679
  generatedExtensions: exports_external.object({
15262
15680
  pctCompleteApp: exports_external.number().optional()
@@ -15269,7 +15687,9 @@ var TimeSpentInput = exports_external.object({
15269
15687
  eventTime: IsoDateTimeString.optional(),
15270
15688
  metricsId: exports_external.string().optional(),
15271
15689
  id: exports_external.string().optional(),
15272
- extensions: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
15690
+ extensions: exports_external.record(exports_external.string(), exports_external.unknown()).optional(),
15691
+ edApp: exports_external.union([exports_external.string(), exports_external.record(exports_external.string(), exports_external.unknown())]).optional(),
15692
+ session: exports_external.union([exports_external.string(), exports_external.record(exports_external.string(), exports_external.unknown())]).optional()
15273
15693
  }).strict();
15274
15694
  var TimebackEvent = exports_external.union([TimebackActivityEvent, TimebackTimeSpentEvent]);
15275
15695
  var CaliperEnvelope = exports_external.object({
@@ -15459,7 +15879,7 @@ var TimebackConfig = exports_external.object({
15459
15879
  path: ["courses"]
15460
15880
  });
15461
15881
  // ../../types/src/zod/edubridge.ts
15462
- var EdubridgeDateString = IsoDateTimeString;
15882
+ var EdubridgeDateString = exports_external.union([IsoDateTimeString, IsoDateString]);
15463
15883
  var EduBridgeEnrollment = exports_external.object({
15464
15884
  id: exports_external.string(),
15465
15885
  role: exports_external.string(),
@@ -16478,7 +16898,7 @@ class Paginator2 extends Paginator {
16478
16898
  params: requestParams,
16479
16899
  max,
16480
16900
  unwrapKey,
16481
- logger: log2,
16901
+ logger: log3,
16482
16902
  transform: transform2
16483
16903
  });
16484
16904
  }
@@ -17778,7 +18198,7 @@ function createOneRosterClient(registry2 = DEFAULT_PROVIDER_REGISTRY) {
17778
18198
  const resolved = resolveToProvider2(config3, registry2);
17779
18199
  if (resolved.mode === "transport") {
17780
18200
  this.transport = resolved.transport;
17781
- log2.info("Client initialized with custom transport");
18201
+ log3.info("Client initialized with custom transport");
17782
18202
  } else {
17783
18203
  const { provider } = resolved;
17784
18204
  const { baseUrl, paths } = provider.getEndpointWithPaths("oneroster");
@@ -17793,7 +18213,7 @@ function createOneRosterClient(registry2 = DEFAULT_PROVIDER_REGISTRY) {
17793
18213
  timeout: provider.timeout,
17794
18214
  paths
17795
18215
  });
17796
- log2.info("Client initialized", {
18216
+ log3.info("Client initialized", {
17797
18217
  platform: provider.platform,
17798
18218
  env: provider.env,
17799
18219
  baseUrl