@shipdit/cli 0.2.2 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.mjs +306 -174
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -77,7 +77,7 @@ function resolveRuntimeConfig(flags, options) {
77
77
  }
78
78
 
79
79
  //#endregion
80
- //#region ../../node_modules/.pnpm/hono@4.13.0/node_modules/hono/dist/utils/cookie.js
80
+ //#region ../../node_modules/.pnpm/hono@4.13.5/node_modules/hono/dist/utils/cookie.js
81
81
  var validCookieNameRegEx = /^[\w!#$%&'*.^`|~+-]+$/;
82
82
  var _serialize = (name, value, opt = {}) => {
83
83
  if (!validCookieNameRegEx.test(name)) throw new Error("Invalid cookie name");
@@ -120,7 +120,7 @@ var serialize = (name, value, opt) => {
120
120
  };
121
121
 
122
122
  //#endregion
123
- //#region ../../node_modules/.pnpm/hono@4.13.0/node_modules/hono/dist/client/utils.js
123
+ //#region ../../node_modules/.pnpm/hono@4.13.5/node_modules/hono/dist/client/utils.js
124
124
  var mergePath = (base, path) => {
125
125
  base = base.replace(/\/+$/, "");
126
126
  base = base + "/";
@@ -130,7 +130,7 @@ var mergePath = (base, path) => {
130
130
  var replaceUrlParam = (urlString, params) => {
131
131
  for (const [k, v] of Object.entries(params)) {
132
132
  const reg = new RegExp("/:" + k + "(?:{[^/]+})?\\??(?=/|$)");
133
- urlString = urlString.replace(reg, v ? `/${v}` : "");
133
+ urlString = urlString.replace(reg, () => v ? `/${v}` : "");
134
134
  }
135
135
  return urlString;
136
136
  };
@@ -138,7 +138,10 @@ var buildSearchParams = (query) => {
138
138
  const searchParams = new URLSearchParams();
139
139
  for (const [k, v] of Object.entries(query)) {
140
140
  if (v === void 0) continue;
141
- if (Array.isArray(v)) for (const v2 of v) searchParams.append(k, v2);
141
+ if (Array.isArray(v)) for (const v2 of v) {
142
+ if (v2 === void 0) continue;
143
+ searchParams.append(k, v2);
144
+ }
142
145
  else searchParams.set(k, v);
143
146
  }
144
147
  return searchParams;
@@ -168,7 +171,7 @@ function deepMerge(target, source) {
168
171
  }
169
172
 
170
173
  //#endregion
171
- //#region ../../node_modules/.pnpm/hono@4.13.0/node_modules/hono/dist/client/client.js
174
+ //#region ../../node_modules/.pnpm/hono@4.13.5/node_modules/hono/dist/client/client.js
172
175
  var createProxy = (callback, path) => {
173
176
  return new Proxy(() => {}, {
174
177
  get(_obj, key) {
@@ -183,6 +186,10 @@ var createProxy = (callback, path) => {
183
186
  }
184
187
  });
185
188
  };
189
+ var appendQueryParams = (url, searchParams) => {
190
+ const queryString = searchParams.toString();
191
+ return queryString ? `${url}?${queryString}` : url;
192
+ };
186
193
  var ClientRequestImpl = class {
187
194
  url;
188
195
  method;
@@ -203,12 +210,15 @@ var ClientRequestImpl = class {
203
210
  const form = new FormData();
204
211
  for (const [k, v] of Object.entries(args.form)) {
205
212
  if (v === void 0) continue;
206
- if (Array.isArray(v)) for (const v2 of v) form.append(k, v2);
213
+ if (Array.isArray(v)) for (const v2 of v) {
214
+ if (v2 === void 0) continue;
215
+ form.append(k, v2);
216
+ }
207
217
  else form.append(k, v);
208
218
  }
209
219
  this.rBody = form;
210
220
  }
211
- if (args.json) {
221
+ if (args.json !== void 0) {
212
222
  this.rBody = JSON.stringify(args.json);
213
223
  this.cType = "application/json";
214
224
  }
@@ -221,15 +231,19 @@ var ClientRequestImpl = class {
221
231
  };
222
232
  if (args?.cookie) {
223
233
  const cookies = [];
224
- for (const [key, value] of Object.entries(args.cookie)) cookies.push(serialize(key, value, { path: "/" }));
225
- headerValues["Cookie"] = cookies.join(",");
234
+ for (const [key, value] of Object.entries(args.cookie)) {
235
+ if (value === void 0) continue;
236
+ cookies.push(serialize(key, value));
237
+ }
238
+ if (cookies.length > 0) headerValues["Cookie"] = cookies.join("; ");
226
239
  }
227
240
  if (this.cType) headerValues["Content-Type"] = this.cType;
228
- const headers = new Headers(headerValues ?? void 0);
241
+ const headers = new Headers();
242
+ for (const [key, value] of Object.entries(headerValues)) if (value !== void 0) headers.set(key, value);
229
243
  let url = this.url;
230
244
  url = removeIndexString(url);
231
245
  url = replaceUrlParam(url, this.pathParams);
232
- if (this.queryParams) url = url + "?" + this.queryParams.toString();
246
+ if (this.queryParams) url = appendQueryParams(url, this.queryParams);
233
247
  methodUpperCase = this.method.toUpperCase();
234
248
  const setBody = !(methodUpperCase === "GET" || methodUpperCase === "HEAD");
235
249
  return (opt?.fetch || fetch)(url, {
@@ -263,19 +277,18 @@ var hc = (baseUrl, options) => createProxy(function proxyCallback(opts) {
263
277
  let result = url;
264
278
  if (opts.args[0]) {
265
279
  if (opts.args[0].param) result = replaceUrlParam(url, opts.args[0].param);
266
- if (opts.args[0].query) result = result + "?" + buildSearchParamsOption(opts.args[0].query).toString();
280
+ if (opts.args[0].query) result = appendQueryParams(result, buildSearchParamsOption(opts.args[0].query));
267
281
  }
268
282
  result = removeIndexString(result);
269
283
  if (method === "url") return new URL(result);
270
284
  return result.slice(baseUrl.replace(/\/+$/, "").length).replace(/^\/?/, "/");
271
285
  }
272
286
  if (method === "ws") {
273
- const webSocketUrl = replaceUrlProtocol(opts.args[0] && opts.args[0].param ? replaceUrlParam(url, opts.args[0].param) : url, "ws");
287
+ const webSocketUrl = replaceUrlProtocol(opts.args[0]?.param ? replaceUrlParam(url, opts.args[0].param) : url, "ws");
274
288
  const targetUrl = new URL(webSocketUrl);
275
289
  const queryParams = opts.args[0]?.query;
276
- if (queryParams) Object.entries(queryParams).forEach(([key, value]) => {
277
- if (Array.isArray(value)) value.forEach((item) => targetUrl.searchParams.append(key, item));
278
- else targetUrl.searchParams.set(key, value);
290
+ if (queryParams) buildSearchParamsOption(queryParams).forEach((value, key) => {
291
+ targetUrl.searchParams.append(key, value);
279
292
  });
280
293
  const establishWebSocket = (...args) => {
281
294
  if (options?.webSocket !== void 0 && typeof options.webSocket === "function") return options.webSocket(...args);
@@ -307,7 +320,12 @@ const t$2 = [
307
320
  `not_found`,
308
321
  `conflict`,
309
322
  `validation_error`,
310
- `internal`
323
+ `payload_too_large`,
324
+ `quota_exceeded`,
325
+ `rate_limited`,
326
+ `internal`,
327
+ `tenant_migrating`,
328
+ `tenant_unavailable`
311
329
  ];
312
330
  function n$2(e) {
313
331
  if (typeof e != `object` || !e || !(`error` in e)) return !1;
@@ -321,22 +339,26 @@ var r$1 = class e extends Error {
321
339
  status;
322
340
  requestId;
323
341
  details;
342
+ retryAfterSeconds;
324
343
  constructor(e) {
325
- super(e.message), this.name = `ShipdApiError`, this.code = e.code, this.status = e.status, this.requestId = e.requestId, this.details = e.details;
344
+ super(e.message), this.name = `ShipdApiError`, this.code = e.code, this.status = e.status, this.requestId = e.requestId, this.details = e.details, this.retryAfterSeconds = e.retryAfterSeconds;
326
345
  }
327
- static fromResponse(r, i) {
346
+ static fromResponse(r, i, a) {
347
+ let o = a == null ? NaN : Number(a), s = Number.isFinite(o) && o >= 0 ? o : void 0;
328
348
  return n$2(i) ? new e({
329
349
  code: t$2.includes(i.error.code) ? i.error.code : `unknown`,
330
350
  message: i.error.message,
331
351
  status: r,
332
352
  requestId: i.error.requestId,
333
- details: i.error.details
353
+ details: i.error.details,
354
+ retryAfterSeconds: s
334
355
  }) : new e({
335
356
  code: `unknown`,
336
357
  message: `Request failed with status ${r}`,
337
358
  status: r,
338
359
  requestId: `unknown`,
339
- details: i
360
+ details: i,
361
+ retryAfterSeconds: s
340
362
  });
341
363
  }
342
364
  };
@@ -352,7 +374,7 @@ async function i$1(e) {
352
374
  requestId: `unknown`
353
375
  });
354
376
  }
355
- if (!e.ok) throw r$1.fromResponse(e.status, t);
377
+ if (!e.ok) throw r$1.fromResponse(e.status, t, e.headers.get(`retry-after`));
356
378
  if (typeof t != `object` || !t || !(`data` in t)) throw new r$1({
357
379
  code: `internal`,
358
380
  message: `Malformed success response`,
@@ -379,10 +401,12 @@ const v$1 = (...t) => hc(...t);
379
401
  const y$1 = (...t) => hc(...t);
380
402
  const b$1 = (...t) => hc(...t);
381
403
  const x$1 = (...t) => hc(...t);
382
- function S$1(e) {
404
+ const S$1 = (...t) => hc(...t);
405
+ const C$1 = (...t) => hc(...t);
406
+ function w$1(e) {
383
407
  return `${e.replace(/\/+$/, ``)}/api/v1/rpc`;
384
408
  }
385
- function C$1(e) {
409
+ function T$1(e) {
386
410
  return {
387
411
  ...e.fetch ? { fetch: e.fetch } : {},
388
412
  init: { credentials: e.client === `dashboard` ? `include` : `same-origin` },
@@ -392,142 +416,171 @@ function C$1(e) {
392
416
  }
393
417
  };
394
418
  }
395
- async function w$1(e, t) {
419
+ async function E$1(e, t) {
396
420
  return i$1(await e({ json: t }));
397
421
  }
398
- function T$1(e) {
399
- let t = S$1(e.baseUrl), n = C$1(e), r = a$1(t, n), i = o$1(t, n), T = s$1(t, n), E = c$1(t, n), D = l$1(t, n), O = u$1(t, n), k = d$2(t, n), A = f$2(t, n), j = g$1(t, n), M = h$1(t, n), N = p$1(t, n), P = m$1(t, n), F = _$1(t, n), I = v$1(t, n), L = y$1(t, n), R = b$1(t, n), z = x$1(t, n);
422
+ async function D$1(e, t) {
423
+ let n = await e({ json: t });
424
+ return {
425
+ items: await i$1(n),
426
+ nextCursor: n.headers.get(`next-cursor`)
427
+ };
428
+ }
429
+ function O$1(e) {
430
+ let t = w$1(e.baseUrl), n = T$1(e), r = a$1(t, n), i = o$1(t, n), O = s$1(t, n), k = c$1(t, n), A = l$1(t, n), j = u$1(t, n), M = d$2(t, n), N = f$2(t, n), P = g$1(t, n), F = h$1(t, n), I = p$1(t, n), L = m$1(t, n), R = _$1(t, n), z = v$1(t, n), B = y$1(t, n), V = C$1(t, n), H = b$1(t, n), U = x$1(t, n), W = S$1(t, n);
400
431
  return {
401
432
  me: {
402
- get: (e = {}) => w$1(r.me.$post, e),
403
- feedback: (e) => w$1(r.me.feedback.$post, e)
433
+ get: (e = {}) => E$1(r.me.$post, e),
434
+ feedback: (e) => E$1(r.me.feedback.$post, e)
404
435
  },
405
436
  project: {
406
- list: (e = {}) => w$1(i.project.list.$post, e),
407
- create: (e) => w$1(i.project.create.$post, e),
408
- update: (e) => w$1(i.project.update.$post, e),
409
- archive: (e) => w$1(i.project.archive.$post, e),
410
- listTeams: (e) => w$1(i.project.listTeams.$post, e),
411
- setTeams: (e) => w$1(i.project.setTeams.$post, e)
437
+ list: (e = {}) => E$1(i.project.list.$post, e),
438
+ create: (e) => E$1(i.project.create.$post, e),
439
+ update: (e) => E$1(i.project.update.$post, e),
440
+ archive: (e) => E$1(i.project.archive.$post, e),
441
+ listTeams: (e) => E$1(i.project.listTeams.$post, e),
442
+ setTeams: (e) => E$1(i.project.setTeams.$post, e)
412
443
  },
413
- team: { listMembers: (e) => w$1(R.team.listMembers.$post, e) },
444
+ team: { listMembers: (e) => E$1(H.team.listMembers.$post, e) },
414
445
  environment: {
415
- list: (e) => w$1(T.environment.list.$post, e),
416
- create: (e) => w$1(T.environment.create.$post, e),
417
- update: (e) => w$1(T.environment.update.$post, e),
418
- archive: (e) => w$1(T.environment.archive.$post, e)
446
+ list: (e) => E$1(O.environment.list.$post, e),
447
+ create: (e) => E$1(O.environment.create.$post, e),
448
+ update: (e) => E$1(O.environment.update.$post, e),
449
+ archive: (e) => E$1(O.environment.archive.$post, e)
419
450
  },
420
451
  flag: {
421
- list: (e) => w$1(E.flag.list.$post, e),
422
- get: (e) => w$1(E.flag.get.$post, e),
423
- create: (e) => w$1(E.flag.create.$post, e),
424
- update: (e) => w$1(E.flag.update.$post, e),
425
- archive: (e) => w$1(E.flag.archive.$post, e),
426
- updateEnvironment: (e) => w$1(E.flag.updateEnvironment.$post, e),
427
- toggleEnvironment: (e) => w$1(E.flag.toggleEnvironment.$post, e),
428
- listEnvironmentStates: (e) => w$1(E.flag.listEnvironmentStates.$post, e),
429
- pull: (e) => w$1(E.flag.pull.$post, e),
430
- diff: (e) => w$1(E.flag.diff.$post, e),
431
- push: (e) => w$1(E.flag.push.$post, e)
452
+ list: (e) => E$1(k.flag.list.$post, e),
453
+ get: (e) => E$1(k.flag.get.$post, e),
454
+ create: (e) => E$1(k.flag.create.$post, e),
455
+ update: (e) => E$1(k.flag.update.$post, e),
456
+ archive: (e) => E$1(k.flag.archive.$post, e),
457
+ updateEnvironment: (e) => E$1(k.flag.updateEnvironment.$post, e),
458
+ toggleEnvironment: (e) => E$1(k.flag.toggleEnvironment.$post, e),
459
+ listEnvironmentStates: (e) => E$1(k.flag.listEnvironmentStates.$post, e),
460
+ pull: (e) => E$1(k.flag.pull.$post, e),
461
+ diff: (e) => E$1(k.flag.diff.$post, e),
462
+ push: (e) => E$1(k.flag.push.$post, e)
432
463
  },
433
464
  apiKey: {
434
- list: (e = {}) => w$1(D.apiKey.list.$post, e),
435
- create: (e) => w$1(D.apiKey.create.$post, e),
436
- revoke: (e) => w$1(D.apiKey.revoke.$post, e)
465
+ list: (e = {}) => E$1(A.apiKey.list.$post, e),
466
+ create: (e) => E$1(A.apiKey.create.$post, e),
467
+ revoke: (e) => E$1(A.apiKey.revoke.$post, e)
437
468
  },
438
469
  sdkKey: {
439
- list: (e = {}) => w$1(A.sdkKey.list.$post, e),
440
- create: (e) => w$1(A.sdkKey.create.$post, e),
441
- revoke: (e) => w$1(A.sdkKey.revoke.$post, e)
470
+ list: (e = {}) => E$1(N.sdkKey.list.$post, e),
471
+ create: (e) => E$1(N.sdkKey.create.$post, e),
472
+ revoke: (e) => E$1(N.sdkKey.revoke.$post, e)
442
473
  },
443
474
  serviceAccount: {
444
- list: (e = {}) => w$1(j.serviceAccount.list.$post, e),
445
- get: (e) => w$1(j.serviceAccount.get.$post, e),
446
- create: (e) => w$1(j.serviceAccount.create.$post, e),
447
- update: (e) => w$1(j.serviceAccount.update.$post, e),
448
- disable: (e) => w$1(j.serviceAccount.disable.$post, e),
449
- enable: (e) => w$1(j.serviceAccount.enable.$post, e),
450
- delete: (e) => w$1(j.serviceAccount.delete.$post, e),
451
- createToken: (e) => w$1(j.serviceAccount.createToken.$post, e),
452
- listTokens: (e) => w$1(j.serviceAccount.listTokens.$post, e),
453
- revokeToken: (e) => w$1(j.serviceAccount.revokeToken.$post, e)
475
+ list: (e = {}) => E$1(P.serviceAccount.list.$post, e),
476
+ get: (e) => E$1(P.serviceAccount.get.$post, e),
477
+ create: (e) => E$1(P.serviceAccount.create.$post, e),
478
+ update: (e) => E$1(P.serviceAccount.update.$post, e),
479
+ disable: (e) => E$1(P.serviceAccount.disable.$post, e),
480
+ enable: (e) => E$1(P.serviceAccount.enable.$post, e),
481
+ delete: (e) => E$1(P.serviceAccount.delete.$post, e),
482
+ createToken: (e) => E$1(P.serviceAccount.createToken.$post, e),
483
+ listTokens: (e) => E$1(P.serviceAccount.listTokens.$post, e),
484
+ revokeToken: (e) => E$1(P.serviceAccount.revokeToken.$post, e),
485
+ rotateToken: (e) => E$1(P.serviceAccount.rotateToken.$post, e)
454
486
  },
455
487
  segment: {
456
- list: (e) => w$1(M.segment.list.$post, e),
457
- get: (e) => w$1(M.segment.get.$post, e),
458
- create: (e) => w$1(M.segment.create.$post, e),
459
- update: (e) => w$1(M.segment.update.$post, e),
460
- archive: (e) => w$1(M.segment.archive.$post, e),
461
- listEnvironmentStates: (e) => w$1(M.segment.listEnvironmentStates.$post, e),
462
- updateEnvironment: (e) => w$1(M.segment.updateEnvironment.$post, e)
488
+ list: (e) => E$1(F.segment.list.$post, e),
489
+ get: (e) => E$1(F.segment.get.$post, e),
490
+ create: (e) => E$1(F.segment.create.$post, e),
491
+ update: (e) => E$1(F.segment.update.$post, e),
492
+ archive: (e) => E$1(F.segment.archive.$post, e),
493
+ listEnvironmentStates: (e) => E$1(F.segment.listEnvironmentStates.$post, e),
494
+ updateEnvironment: (e) => E$1(F.segment.updateEnvironment.$post, e)
463
495
  },
464
496
  evaluatedEntity: {
465
- list: (e) => w$1(N.evaluatedEntity.list.$post, e),
466
- get: (e) => w$1(N.evaluatedEntity.get.$post, e),
467
- delete: (e) => w$1(N.evaluatedEntity.delete.$post, e)
497
+ list: (e) => E$1(I.evaluatedEntity.list.$post, e),
498
+ listPage: (e) => D$1(I.evaluatedEntity.list.$post, e),
499
+ get: (e) => E$1(I.evaluatedEntity.get.$post, e),
500
+ delete: (e) => E$1(I.evaluatedEntity.delete.$post, e)
468
501
  },
469
502
  evaluationFact: {
470
- list: (e) => w$1(P.evaluationFact.list.$post, e),
471
- byRule: (e) => w$1(P.evaluationFact.byRule.$post, e),
472
- orgSummary: (e = {}) => w$1(P.evaluationFact.orgSummary.$post, e),
473
- projectSummary: (e) => w$1(P.evaluationFact.projectSummary.$post, e),
474
- simulate: (e) => w$1(P.evaluationFact.simulate.$post, e)
503
+ list: (e) => E$1(L.evaluationFact.list.$post, e),
504
+ byRule: (e) => E$1(L.evaluationFact.byRule.$post, e),
505
+ orgSummary: (e = {}) => E$1(L.evaluationFact.orgSummary.$post, e),
506
+ projectSummary: (e) => E$1(L.evaluationFact.projectSummary.$post, e),
507
+ simulate: (e) => E$1(L.evaluationFact.simulate.$post, e)
475
508
  },
476
- snapshot: { publish: (e) => w$1(F.snapshot.publish.$post, e) },
477
- device: { authorize: (e) => w$1(I.device.authorize.$post, e) },
509
+ snapshot: {
510
+ publish: (e) => E$1(R.snapshot.publish.$post, e),
511
+ listOutbox: (e = {}) => E$1(R.snapshot.outbox.list.$post, e),
512
+ listOutboxPage: (e = {}) => D$1(R.snapshot.outbox.list.$post, e),
513
+ requeue: (e) => E$1(R.snapshot.outbox.requeue.$post, e),
514
+ rebuild: (e) => E$1(R.snapshot.rebuild.$post, e),
515
+ listPublications: (e) => E$1(R.snapshot.publications.list.$post, e),
516
+ listPublicationsPage: (e) => D$1(R.snapshot.publications.list.$post, e)
517
+ },
518
+ device: { authorize: (e) => E$1(z.device.authorize.$post, e) },
478
519
  billing: {
479
- get: (e = {}) => w$1(L.billing.get.$post, e),
480
- attach: (e) => w$1(L.billing.attach.$post, e),
481
- openPortal: (e) => w$1(L.billing.openPortal.$post, e)
520
+ get: (e = {}) => E$1(B.billing.get.$post, e),
521
+ attach: (e) => E$1(B.billing.attach.$post, e),
522
+ openPortal: (e) => E$1(B.billing.openPortal.$post, e)
482
523
  },
524
+ usage: { get: (e = {}) => E$1(V.usage.get.$post, e) },
483
525
  approval: {
484
- listPolicies: (e = {}) => w$1(O.approval.listPolicies.$post, e),
485
- createPolicy: (e) => w$1(O.approval.createPolicy.$post, e),
486
- updatePolicy: (e) => w$1(O.approval.updatePolicy.$post, e),
487
- deletePolicy: (e) => w$1(O.approval.deletePolicy.$post, e),
488
- listRequests: (e = {}) => w$1(O.approval.listRequests.$post, e),
489
- get: (e) => w$1(O.approval.get.$post, e),
490
- approve: (e) => w$1(O.approval.approve.$post, e),
491
- reject: (e) => w$1(O.approval.reject.$post, e),
492
- cancel: (e) => w$1(O.approval.cancel.$post, e)
526
+ listPolicies: (e = {}) => E$1(j.approval.listPolicies.$post, e),
527
+ createPolicy: (e) => E$1(j.approval.createPolicy.$post, e),
528
+ updatePolicy: (e) => E$1(j.approval.updatePolicy.$post, e),
529
+ deletePolicy: (e) => E$1(j.approval.deletePolicy.$post, e),
530
+ listRequests: (e = {}) => E$1(j.approval.listRequests.$post, e),
531
+ listRequestsPage: (e = {}) => D$1(j.approval.listRequests.$post, e),
532
+ get: (e) => E$1(j.approval.get.$post, e),
533
+ approve: (e) => E$1(j.approval.approve.$post, e),
534
+ reject: (e) => E$1(j.approval.reject.$post, e),
535
+ cancel: (e) => E$1(j.approval.cancel.$post, e)
493
536
  },
494
537
  audit: {
495
- list: (e = {}) => w$1(k.audit.list.$post, e),
496
- get: (e) => w$1(k.audit.get.$post, e),
497
- actions: (e = {}) => w$1(k.audit.actions.$post, e),
498
- export: (e) => w$1(k.audit.export.$post, e),
499
- getSettings: (e = {}) => w$1(k.audit.getSettings.$post, e),
500
- updateSettings: (e) => w$1(k.audit.updateSettings.$post, e),
501
- listDestinations: (e = {}) => w$1(k.audit.listDestinations.$post, e),
502
- createDestination: (e) => w$1(k.audit.createDestination.$post, e),
503
- updateDestination: (e) => w$1(k.audit.updateDestination.$post, e),
504
- deleteDestination: (e) => w$1(k.audit.deleteDestination.$post, e),
505
- testDestination: (e) => w$1(k.audit.testDestination.$post, e)
538
+ list: (e = {}) => E$1(M.audit.list.$post, e),
539
+ get: (e) => E$1(M.audit.get.$post, e),
540
+ actions: (e = {}) => E$1(M.audit.actions.$post, e),
541
+ export: (e) => E$1(M.audit.export.$post, e),
542
+ getSettings: (e = {}) => E$1(M.audit.getSettings.$post, e),
543
+ updateSettings: (e) => E$1(M.audit.updateSettings.$post, e),
544
+ listDestinations: (e = {}) => E$1(M.audit.listDestinations.$post, e),
545
+ createDestination: (e) => E$1(M.audit.createDestination.$post, e),
546
+ updateDestination: (e) => E$1(M.audit.updateDestination.$post, e),
547
+ deleteDestination: (e) => E$1(M.audit.deleteDestination.$post, e),
548
+ testDestination: (e) => E$1(M.audit.testDestination.$post, e)
506
549
  },
507
550
  sso: {
508
- getSettings: (e = {}) => w$1(z.sso.getSettings.$post, e),
509
- listProviders: (e = {}) => w$1(z.sso.listProviders.$post, e),
510
- updateAllowedDomains: (e) => w$1(z.sso.updateAllowedDomains.$post, e),
511
- setEnforcement: (e) => w$1(z.sso.setEnforcement.$post, e)
551
+ getSettings: (e = {}) => E$1(U.sso.getSettings.$post, e),
552
+ listProviders: (e = {}) => E$1(U.sso.listProviders.$post, e),
553
+ updateAllowedDomains: (e) => E$1(U.sso.updateAllowedDomains.$post, e),
554
+ setEnforcement: (e) => E$1(U.sso.setEnforcement.$post, e),
555
+ setRequireTwoFactor: (e) => E$1(U.sso.setRequireTwoFactor.$post, e)
556
+ },
557
+ scim: {
558
+ getConnection: (e = {}) => E$1(W.scim.getConnection.$post, e),
559
+ createConnection: (e = { creationRequestId: crypto.randomUUID() }) => E$1(W.scim.createConnection.$post, e),
560
+ rotateCredential: (e) => E$1(W.scim.rotateCredential.$post, e),
561
+ revokeCredential: (e) => E$1(W.scim.revokeCredential.$post, e),
562
+ decommissionConnection: (e) => E$1(W.scim.decommissionConnection.$post, e)
512
563
  },
513
564
  raw: {
514
565
  me: r,
515
566
  project: i,
516
- environment: T,
517
- flag: E,
518
- apiKey: D,
519
- approval: O,
520
- audit: k,
521
- sdkKey: A,
522
- serviceAccount: j,
523
- segment: M,
524
- evaluatedEntity: N,
525
- evaluationFact: P,
526
- snapshot: F,
527
- device: I,
528
- billing: L,
529
- team: R,
530
- sso: z
567
+ environment: O,
568
+ flag: k,
569
+ apiKey: A,
570
+ approval: j,
571
+ audit: M,
572
+ sdkKey: N,
573
+ serviceAccount: P,
574
+ segment: F,
575
+ evaluatedEntity: I,
576
+ evaluationFact: L,
577
+ snapshot: R,
578
+ device: z,
579
+ billing: B,
580
+ usage: V,
581
+ team: H,
582
+ sso: U,
583
+ scim: W
531
584
  }
532
585
  };
533
586
  }
@@ -671,7 +724,7 @@ var BetterAuthError = class extends Error {
671
724
  };
672
725
 
673
726
  //#endregion
674
- //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._0f4663e1f35d01509eefb20039600143/node_modules/better-auth/dist/plugins/access/access.mjs
727
+ //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._29983ac85a08632d26ca60fb0be17581/node_modules/better-auth/dist/plugins/access/access.mjs
675
728
  function unknownResourceResponse(requestedResource) {
676
729
  return {
677
730
  success: false,
@@ -748,7 +801,7 @@ function createAccessControl(s) {
748
801
  }
749
802
 
750
803
  //#endregion
751
- //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._0f4663e1f35d01509eefb20039600143/node_modules/better-auth/dist/plugins/two-factor/error-code.mjs
804
+ //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._29983ac85a08632d26ca60fb0be17581/node_modules/better-auth/dist/plugins/two-factor/error-code.mjs
752
805
  const TWO_FACTOR_ERROR_CODES = defineErrorCodes({
753
806
  OTP_NOT_ENABLED: "OTP not enabled",
754
807
  OTP_NOT_CONFIGURED: "OTP is not available",
@@ -765,11 +818,11 @@ const TWO_FACTOR_ERROR_CODES = defineErrorCodes({
765
818
  });
766
819
 
767
820
  //#endregion
768
- //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._0f4663e1f35d01509eefb20039600143/node_modules/better-auth/dist/package.mjs
821
+ //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._29983ac85a08632d26ca60fb0be17581/node_modules/better-auth/dist/package.mjs
769
822
  var version = "1.7.1";
770
823
 
771
824
  //#endregion
772
- //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._0f4663e1f35d01509eefb20039600143/node_modules/better-auth/dist/version.mjs
825
+ //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._29983ac85a08632d26ca60fb0be17581/node_modules/better-auth/dist/version.mjs
773
826
  const PACKAGE_VERSION$3 = version;
774
827
 
775
828
  //#endregion
@@ -805,7 +858,7 @@ function isSafeUrlScheme(value) {
805
858
  }
806
859
 
807
860
  //#endregion
808
- //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._0f4663e1f35d01509eefb20039600143/node_modules/better-auth/dist/plugins/two-factor/client.mjs
861
+ //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._29983ac85a08632d26ca60fb0be17581/node_modules/better-auth/dist/plugins/two-factor/client.mjs
809
862
  const twoFactorClient = (options) => {
810
863
  return {
811
864
  id: "two-factor",
@@ -843,7 +896,7 @@ const twoFactorClient = (options) => {
843
896
  };
844
897
 
845
898
  //#endregion
846
- //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._0f4663e1f35d01509eefb20039600143/node_modules/better-auth/dist/plugins/admin/access/statement.mjs
899
+ //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._29983ac85a08632d26ca60fb0be17581/node_modules/better-auth/dist/plugins/admin/access/statement.mjs
847
900
  const defaultStatements$1 = {
848
901
  user: [
849
902
  "create",
@@ -894,7 +947,7 @@ const defaultRoles$1 = {
894
947
  };
895
948
 
896
949
  //#endregion
897
- //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._0f4663e1f35d01509eefb20039600143/node_modules/better-auth/dist/plugins/admin/error-codes.mjs
950
+ //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._29983ac85a08632d26ca60fb0be17581/node_modules/better-auth/dist/plugins/admin/error-codes.mjs
898
951
  const ADMIN_ERROR_CODES = defineErrorCodes({
899
952
  FAILED_TO_CREATE_USER: "Failed to create user",
900
953
  USER_ALREADY_EXISTS: "User already exists.",
@@ -986,7 +1039,7 @@ const ENV = Object.freeze({
986
1039
  });
987
1040
 
988
1041
  //#endregion
989
- //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._0f4663e1f35d01509eefb20039600143/node_modules/better-auth/dist/utils/url.mjs
1042
+ //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._29983ac85a08632d26ca60fb0be17581/node_modules/better-auth/dist/utils/url.mjs
990
1043
  const SLASH_CHAR_CODE = "/".charCodeAt(0);
991
1044
  function trimTrailingSlashes(value) {
992
1045
  let end = value.length;
@@ -1065,7 +1118,7 @@ function getOrigin(url) {
1065
1118
  }
1066
1119
 
1067
1120
  //#endregion
1068
- //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._0f4663e1f35d01509eefb20039600143/node_modules/better-auth/dist/plugins/admin/has-permission.mjs
1121
+ //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._29983ac85a08632d26ca60fb0be17581/node_modules/better-auth/dist/plugins/admin/has-permission.mjs
1069
1122
  const hasPermission = (input) => {
1070
1123
  if (input.userId && input.options?.adminUserIds?.includes(input.userId)) return true;
1071
1124
  if (!input.permissions) return false;
@@ -1594,7 +1647,7 @@ var betterFetch = async (url, options) => {
1594
1647
  };
1595
1648
 
1596
1649
  //#endregion
1597
- //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._0f4663e1f35d01509eefb20039600143/node_modules/better-auth/dist/client/parser.mjs
1650
+ //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._29983ac85a08632d26ca60fb0be17581/node_modules/better-auth/dist/client/parser.mjs
1598
1651
  const PROTO_POLLUTION_PATTERNS = {
1599
1652
  proto: /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,
1600
1653
  constructor: /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,
@@ -1664,7 +1717,7 @@ function parseJSON(value, options = { strict: true }) {
1664
1717
  }
1665
1718
 
1666
1719
  //#endregion
1667
- //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._0f4663e1f35d01509eefb20039600143/node_modules/better-auth/dist/plugins/organization/access/statement.mjs
1720
+ //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._29983ac85a08632d26ca60fb0be17581/node_modules/better-auth/dist/plugins/organization/access/statement.mjs
1668
1721
  const defaultStatements = {
1669
1722
  organization: ["update", "delete"],
1670
1723
  member: [
@@ -1740,7 +1793,7 @@ const defaultRoles = {
1740
1793
  };
1741
1794
 
1742
1795
  //#endregion
1743
- //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._0f4663e1f35d01509eefb20039600143/node_modules/better-auth/dist/plugins/organization/permission.mjs
1796
+ //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._29983ac85a08632d26ca60fb0be17581/node_modules/better-auth/dist/plugins/organization/permission.mjs
1744
1797
  const hasPermissionFn = (input, acRoles) => {
1745
1798
  if (!input.permissions) return false;
1746
1799
  const roles = input.role.split(",");
@@ -1753,7 +1806,7 @@ const hasPermissionFn = (input, acRoles) => {
1753
1806
  };
1754
1807
 
1755
1808
  //#endregion
1756
- //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._0f4663e1f35d01509eefb20039600143/node_modules/better-auth/dist/plugins/organization/error-codes.mjs
1809
+ //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._29983ac85a08632d26ca60fb0be17581/node_modules/better-auth/dist/plugins/organization/error-codes.mjs
1757
1810
  const ORGANIZATION_ERROR_CODES = defineErrorCodes({
1758
1811
  YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION: "You are not allowed to create a new organization",
1759
1812
  YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS: "You have reached the maximum number of organizations",
@@ -1834,8 +1887,12 @@ const t$1 = createAccessControl({
1834
1887
  `delete`
1835
1888
  ],
1836
1889
  audit: [`read`],
1837
- approval_policy: [`update`],
1838
- approval_request: [`review`],
1890
+ approval_policy: [`read`, `update`],
1891
+ approval_request: [
1892
+ `read`,
1893
+ `review`,
1894
+ `cancel`
1895
+ ],
1839
1896
  project: [
1840
1897
  `create`,
1841
1898
  `read`,
@@ -1869,6 +1926,7 @@ const t$1 = createAccessControl({
1869
1926
  `revoke`
1870
1927
  ],
1871
1928
  evaluated_entity: [`read`, `delete`],
1929
+ snapshot: [`read`],
1872
1930
  billing: [`read`, `manage`],
1873
1931
  sso: [
1874
1932
  `read`,
@@ -1896,7 +1954,9 @@ const n$1 = {
1896
1954
  environment: [`read`],
1897
1955
  flag: [`read`],
1898
1956
  evaluated_entity: [`read`],
1899
- billing: [`read`]
1957
+ billing: [`read`],
1958
+ approval_policy: [`read`],
1959
+ approval_request: [`read`]
1900
1960
  }),
1901
1961
  editor: t$1.newRole({
1902
1962
  member: [`read`],
@@ -1917,14 +1977,17 @@ const n$1 = {
1917
1977
  `revoke`
1918
1978
  ],
1919
1979
  evaluated_entity: [`read`],
1920
- billing: [`read`]
1980
+ billing: [`read`],
1981
+ approval_policy: [`read`],
1982
+ approval_request: [`read`]
1921
1983
  }),
1922
1984
  admin: t$1.newRole({
1923
1985
  organization: [`update`],
1924
1986
  member: [
1925
1987
  `create`,
1926
1988
  `read`,
1927
- `update`
1989
+ `update`,
1990
+ `delete`
1928
1991
  ],
1929
1992
  invitation: [`create`, `cancel`],
1930
1993
  team: [
@@ -1934,8 +1997,12 @@ const n$1 = {
1934
1997
  `delete`
1935
1998
  ],
1936
1999
  audit: [`read`],
1937
- approval_policy: [`update`],
1938
- approval_request: [`review`],
2000
+ approval_policy: [`read`, `update`],
2001
+ approval_request: [
2002
+ `read`,
2003
+ `review`,
2004
+ `cancel`
2005
+ ],
1939
2006
  project: [
1940
2007
  `create`,
1941
2008
  `read`,
@@ -1969,6 +2036,7 @@ const n$1 = {
1969
2036
  `revoke`
1970
2037
  ],
1971
2038
  evaluated_entity: [`read`, `delete`],
2039
+ snapshot: [`read`],
1972
2040
  billing: [`read`, `manage`],
1973
2041
  sso: [`read`, `manage`],
1974
2042
  service_account: [
@@ -2000,8 +2068,12 @@ const n$1 = {
2000
2068
  `delete`
2001
2069
  ],
2002
2070
  audit: [`read`],
2003
- approval_policy: [`update`],
2004
- approval_request: [`review`],
2071
+ approval_policy: [`read`, `update`],
2072
+ approval_request: [
2073
+ `read`,
2074
+ `review`,
2075
+ `cancel`
2076
+ ],
2005
2077
  project: [
2006
2078
  `create`,
2007
2079
  `read`,
@@ -2035,6 +2107,7 @@ const n$1 = {
2035
2107
  `revoke`
2036
2108
  ],
2037
2109
  evaluated_entity: [`read`, `delete`],
2110
+ snapshot: [`read`],
2038
2111
  billing: [`read`, `manage`],
2039
2112
  sso: [
2040
2113
  `read`,
@@ -2057,7 +2130,7 @@ const n$1 = {
2057
2130
  };
2058
2131
 
2059
2132
  //#endregion
2060
- //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._0f4663e1f35d01509eefb20039600143/node_modules/better-auth/dist/client/broadcast-channel.mjs
2133
+ //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._29983ac85a08632d26ca60fb0be17581/node_modules/better-auth/dist/client/broadcast-channel.mjs
2061
2134
  const kBroadcastChannel = Symbol.for("better-auth:broadcast-channel");
2062
2135
  const now$1 = () => Math.floor(Date.now() / 1e3);
2063
2136
  var WindowBroadcastChannel = class {
@@ -2281,7 +2354,7 @@ let onMount = ($store, initialize) => {
2281
2354
  };
2282
2355
 
2283
2356
  //#endregion
2284
- //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._0f4663e1f35d01509eefb20039600143/node_modules/better-auth/dist/client/equality.mjs
2357
+ //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._29983ac85a08632d26ca60fb0be17581/node_modules/better-auth/dist/client/equality.mjs
2285
2358
  function isPlainObject(value) {
2286
2359
  if (typeof value !== "object" || value === null) return false;
2287
2360
  const prototype = Object.getPrototypeOf(value);
@@ -2322,7 +2395,7 @@ function withEquality(store, isEqual) {
2322
2395
  }
2323
2396
 
2324
2397
  //#endregion
2325
- //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._0f4663e1f35d01509eefb20039600143/node_modules/better-auth/dist/client/focus-manager.mjs
2398
+ //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._29983ac85a08632d26ca60fb0be17581/node_modules/better-auth/dist/client/focus-manager.mjs
2326
2399
  const kFocusManager = Symbol.for("better-auth:focus-manager");
2327
2400
  var WindowFocusManager = class {
2328
2401
  listeners = /* @__PURE__ */ new Set();
@@ -2352,7 +2425,7 @@ function getGlobalFocusManager() {
2352
2425
  }
2353
2426
 
2354
2427
  //#endregion
2355
- //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._0f4663e1f35d01509eefb20039600143/node_modules/better-auth/dist/client/online-manager.mjs
2428
+ //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._29983ac85a08632d26ca60fb0be17581/node_modules/better-auth/dist/client/online-manager.mjs
2356
2429
  const kOnlineManager = Symbol.for("better-auth:online-manager");
2357
2430
  var WindowOnlineManager = class {
2358
2431
  listeners = /* @__PURE__ */ new Set();
@@ -2385,7 +2458,7 @@ function getGlobalOnlineManager() {
2385
2458
  }
2386
2459
 
2387
2460
  //#endregion
2388
- //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._0f4663e1f35d01509eefb20039600143/node_modules/better-auth/dist/client/query.mjs
2461
+ //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._29983ac85a08632d26ca60fb0be17581/node_modules/better-auth/dist/client/query.mjs
2389
2462
  const isServer$1 = () => typeof window === "undefined";
2390
2463
  function isAuthQueryStateEqual(a, b) {
2391
2464
  return isJsonEqual(a.data, b.data) && a.error === b.error && a.isPending === b.isPending && a.isRefetching === b.isRefetching && a.refetch === b.refetch;
@@ -2507,7 +2580,7 @@ const useAuthQuery = (initializedAtom, path, $fetch, options) => {
2507
2580
  };
2508
2581
 
2509
2582
  //#endregion
2510
- //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._0f4663e1f35d01509eefb20039600143/node_modules/better-auth/dist/client/session-refresh.mjs
2583
+ //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._29983ac85a08632d26ca60fb0be17581/node_modules/better-auth/dist/client/session-refresh.mjs
2511
2584
  const now = () => Math.floor(Date.now() / 1e3);
2512
2585
  /**
2513
2586
  * Rate limit: don't refetch on focus if a session request was made within this many seconds
@@ -2635,7 +2708,7 @@ function createSessionRefreshManager(opts) {
2635
2708
  }
2636
2709
 
2637
2710
  //#endregion
2638
- //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._0f4663e1f35d01509eefb20039600143/node_modules/better-auth/dist/client/fetch-plugins.mjs
2711
+ //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._29983ac85a08632d26ca60fb0be17581/node_modules/better-auth/dist/client/fetch-plugins.mjs
2639
2712
  const redirectPlugin = {
2640
2713
  id: "redirect",
2641
2714
  name: "Redirect",
@@ -2651,7 +2724,7 @@ const redirectPlugin = {
2651
2724
  };
2652
2725
 
2653
2726
  //#endregion
2654
- //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._0f4663e1f35d01509eefb20039600143/node_modules/better-auth/dist/client/session-atom.mjs
2727
+ //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._29983ac85a08632d26ca60fb0be17581/node_modules/better-auth/dist/client/session-atom.mjs
2655
2728
  const isServer = () => typeof window === "undefined";
2656
2729
  const SESSION_MOUNT_DEDUPE_INTERVAL = STORE_UNMOUNT_DELAY;
2657
2730
  function hydrateSessionAtom(sessionAtom, session) {
@@ -2826,7 +2899,7 @@ function getSessionAtom($fetch, options) {
2826
2899
  }
2827
2900
 
2828
2901
  //#endregion
2829
- //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._0f4663e1f35d01509eefb20039600143/node_modules/better-auth/dist/client/config.mjs
2902
+ //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._29983ac85a08632d26ca60fb0be17581/node_modules/better-auth/dist/client/config.mjs
2830
2903
  const resolvePublicAuthUrl = (basePath) => {
2831
2904
  if (typeof process === "undefined") return void 0;
2832
2905
  const path = basePath ?? "/api/auth";
@@ -2932,7 +3005,7 @@ const getClientConfig = (options, loadEnv) => {
2932
3005
  };
2933
3006
 
2934
3007
  //#endregion
2935
- //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._0f4663e1f35d01509eefb20039600143/node_modules/better-auth/dist/utils/is-atom.mjs
3008
+ //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._29983ac85a08632d26ca60fb0be17581/node_modules/better-auth/dist/utils/is-atom.mjs
2936
3009
  function isAtom(value) {
2937
3010
  return typeof value === "object" && value !== null && "get" in value && typeof value.get === "function" && "lc" in value && typeof value.lc === "number";
2938
3011
  }
@@ -2952,7 +3025,7 @@ function toKebabCase(input) {
2952
3025
  }
2953
3026
 
2954
3027
  //#endregion
2955
- //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._0f4663e1f35d01509eefb20039600143/node_modules/better-auth/dist/client/proxy.mjs
3028
+ //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._29983ac85a08632d26ca60fb0be17581/node_modules/better-auth/dist/client/proxy.mjs
2956
3029
  function getMethod(path, knownPathMethods, args) {
2957
3030
  const method = knownPathMethods[path];
2958
3031
  const { fetchOptions, query: _query, ...body } = args || {};
@@ -3028,7 +3101,7 @@ function createDynamicPathProxy(routes, client, knownPathMethods, atoms, atomLis
3028
3101
  }
3029
3102
 
3030
3103
  //#endregion
3031
- //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._0f4663e1f35d01509eefb20039600143/node_modules/better-auth/dist/client/vanilla.mjs
3104
+ //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._29983ac85a08632d26ca60fb0be17581/node_modules/better-auth/dist/client/vanilla.mjs
3032
3105
  function createAuthClient(options) {
3033
3106
  const { pluginPathMethods, pluginsActions, pluginsAtoms, hydrateSession, $fetch, atomListeners, $store } = getClientConfig(options);
3034
3107
  const resolvedHooks = {};
@@ -3043,7 +3116,7 @@ function createAuthClient(options) {
3043
3116
  }
3044
3117
 
3045
3118
  //#endregion
3046
- //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._0f4663e1f35d01509eefb20039600143/node_modules/better-auth/dist/plugins/additional-fields/client.mjs
3119
+ //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._29983ac85a08632d26ca60fb0be17581/node_modules/better-auth/dist/plugins/additional-fields/client.mjs
3047
3120
  const inferAdditionalFields = (schema) => {
3048
3121
  return {
3049
3122
  id: "additional-fields-client",
@@ -3053,7 +3126,7 @@ const inferAdditionalFields = (schema) => {
3053
3126
  };
3054
3127
 
3055
3128
  //#endregion
3056
- //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._0f4663e1f35d01509eefb20039600143/node_modules/better-auth/dist/plugins/admin/client.mjs
3129
+ //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._29983ac85a08632d26ca60fb0be17581/node_modules/better-auth/dist/plugins/admin/client.mjs
3057
3130
  const adminClient = (options) => {
3058
3131
  const roles = {
3059
3132
  admin: adminAc$1,
@@ -3088,7 +3161,7 @@ const adminClient = (options) => {
3088
3161
  };
3089
3162
 
3090
3163
  //#endregion
3091
- //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._0f4663e1f35d01509eefb20039600143/node_modules/better-auth/dist/plugins/device-authorization/client.mjs
3164
+ //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._29983ac85a08632d26ca60fb0be17581/node_modules/better-auth/dist/plugins/device-authorization/client.mjs
3092
3165
  const deviceAuthorizationClient = () => {
3093
3166
  return {
3094
3167
  id: "device-authorization",
@@ -3105,7 +3178,7 @@ const deviceAuthorizationClient = () => {
3105
3178
  };
3106
3179
 
3107
3180
  //#endregion
3108
- //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._0f4663e1f35d01509eefb20039600143/node_modules/better-auth/dist/plugins/organization/client.mjs
3181
+ //#region ../../node_modules/.pnpm/better-auth@1.7.1_@opentelemetry+api@1.9.1_drizzle-kit@1.0.0-rc.4_drizzle-orm@1.0.0-rc._29983ac85a08632d26ca60fb0be17581/node_modules/better-auth/dist/plugins/organization/client.mjs
3109
3182
  /**
3110
3183
  * Using the same `hasPermissionFn` function, but without the need for a `ctx` parameter or the `organizationId` parameter.
3111
3184
  */
@@ -3200,7 +3273,7 @@ const organizationClient = (options) => {
3200
3273
  };
3201
3274
 
3202
3275
  //#endregion
3203
- //#region ../../node_modules/.pnpm/@better-auth+api-key@1.7.1_@better-auth+core@1.7.1_@better-auth+utils@0.4.2_@better-fet_2568c45b7ee73e55b396faf3d8bd3e1a/node_modules/@better-auth/api-key/dist/version-D365O1mH.mjs
3276
+ //#region ../../node_modules/.pnpm/@better-auth+api-key@1.7.1_@better-auth+core@1.7.1_@better-auth+utils@0.4.2_@better-fet_a4fe5759ddb57f435137bfe015134721/node_modules/@better-auth/api-key/dist/version-D365O1mH.mjs
3204
3277
  const API_KEY_ERROR_CODES = defineErrorCodes({
3205
3278
  INVALID_METADATA_TYPE: "metadata must be an object or undefined",
3206
3279
  REFILL_AMOUNT_AND_INTERVAL_REQUIRED: "refillAmount is required when refillInterval is provided",
@@ -3237,7 +3310,7 @@ const API_KEY_ERROR_CODES = defineErrorCodes({
3237
3310
  const PACKAGE_VERSION$2 = "1.7.1";
3238
3311
 
3239
3312
  //#endregion
3240
- //#region ../../node_modules/.pnpm/@better-auth+api-key@1.7.1_@better-auth+core@1.7.1_@better-auth+utils@0.4.2_@better-fet_2568c45b7ee73e55b396faf3d8bd3e1a/node_modules/@better-auth/api-key/dist/client.mjs
3313
+ //#region ../../node_modules/.pnpm/@better-auth+api-key@1.7.1_@better-auth+core@1.7.1_@better-auth+utils@0.4.2_@better-fet_a4fe5759ddb57f435137bfe015134721/node_modules/@better-auth/api-key/dist/client.mjs
3241
3314
  const apiKeyClient = () => {
3242
3315
  return {
3243
3316
  id: "api-key",
@@ -3253,7 +3326,7 @@ const apiKeyClient = () => {
3253
3326
  };
3254
3327
 
3255
3328
  //#endregion
3256
- //#region ../../node_modules/.pnpm/@better-auth+passkey@1.7.1_@better-auth+core@1.7.1_@better-auth+utils@0.4.2_@better-fet_3e5015565ab35cd7b806fd7cb64ff2ec/node_modules/@better-auth/passkey/dist/version-CNE1I0BY.mjs
3329
+ //#region ../../node_modules/.pnpm/@better-auth+passkey@1.7.1_@better-auth+core@1.7.1_@better-auth+utils@0.4.2_@better-fet_670374e089e097efe27e0c3a48cf5b4e/node_modules/@better-auth/passkey/dist/version-CNE1I0BY.mjs
3257
3330
  const PASSKEY_ERROR_CODES = defineErrorCodes({
3258
3331
  CHALLENGE_NOT_FOUND: "Challenge not found",
3259
3332
  YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY: "You are not allowed to register this passkey",
@@ -3743,7 +3816,7 @@ async function startAuthentication(options) {
3743
3816
  }
3744
3817
 
3745
3818
  //#endregion
3746
- //#region ../../node_modules/.pnpm/@better-auth+passkey@1.7.1_@better-auth+core@1.7.1_@better-auth+utils@0.4.2_@better-fet_3e5015565ab35cd7b806fd7cb64ff2ec/node_modules/@better-auth/passkey/dist/client.mjs
3819
+ //#region ../../node_modules/.pnpm/@better-auth+passkey@1.7.1_@better-auth+core@1.7.1_@better-auth+utils@0.4.2_@better-fet_670374e089e097efe27e0c3a48cf5b4e/node_modules/@better-auth/passkey/dist/client.mjs
3747
3820
  const getPasskeyActions = ($fetch, { $listPasskeys, $store }) => {
3748
3821
  const signInPasskey = async (opts, options) => {
3749
3822
  const response = await $fetch("/passkey/generate-authenticate-options", {
@@ -3945,11 +4018,11 @@ const passkeyClient = () => {
3945
4018
  };
3946
4019
 
3947
4020
  //#endregion
3948
- //#region ../../node_modules/.pnpm/@better-auth+sso@1.7.1_@better-auth+core@1.7.1_@better-auth+utils@0.4.2_@better-fetch+f_ab392d2d19ca264106fdcee67033c1f1/node_modules/@better-auth/sso/dist/version-BbG1DbY-.mjs
4021
+ //#region ../../node_modules/.pnpm/@better-auth+sso@1.7.1_@better-auth+core@1.7.1_@better-auth+utils@0.4.2_@better-fetch+f_f113731728b549e501373576d6a425b0/node_modules/@better-auth/sso/dist/version-BbG1DbY-.mjs
3949
4022
  const PACKAGE_VERSION = "1.7.1";
3950
4023
 
3951
4024
  //#endregion
3952
- //#region ../../node_modules/.pnpm/@better-auth+sso@1.7.1_@better-auth+core@1.7.1_@better-auth+utils@0.4.2_@better-fetch+f_ab392d2d19ca264106fdcee67033c1f1/node_modules/@better-auth/sso/dist/client.mjs
4025
+ //#region ../../node_modules/.pnpm/@better-auth+sso@1.7.1_@better-auth+core@1.7.1_@better-auth+utils@0.4.2_@better-fetch+f_f113731728b549e501373576d6a425b0/node_modules/@better-auth/sso/dist/client.mjs
3953
4026
  const ssoClient = (options) => {
3954
4027
  return {
3955
4028
  id: "sso-client",
@@ -4086,7 +4159,7 @@ async function createCliApiClient(runtime) {
4086
4159
  sessionToken,
4087
4160
  orgSlug: runtime.org
4088
4161
  });
4089
- const client = T$1({
4162
+ const client = O$1({
4090
4163
  baseUrl: runtime.apiUrl,
4091
4164
  client: "cli",
4092
4165
  getHeaders: () => {
@@ -4542,7 +4615,7 @@ function V(e, t) {
4542
4615
  const H = z.object({
4543
4616
  projectId: z.string().min(1),
4544
4617
  environmentId: z.string().min(1),
4545
- flags: z.array(I)
4618
+ flags: z.array(I).max(500)
4546
4619
  }).superRefine((e, t) => V(e.flags, t));
4547
4620
  const U = z.object({
4548
4621
  key: z.string(),
@@ -4565,7 +4638,7 @@ const W = z.object({
4565
4638
  const G = z.object({
4566
4639
  projectId: z.string().min(1),
4567
4640
  environmentId: z.string().min(1),
4568
- flags: z.array(I),
4641
+ flags: z.array(I).max(500),
4569
4642
  apply: z.boolean().default(!1),
4570
4643
  prune: z.boolean().default(!1),
4571
4644
  force: z.boolean().default(!1),
@@ -5076,6 +5149,7 @@ function registerPushCommand(program) {
5076
5149
  remoteOnly,
5077
5150
  forced: applied.forced === true,
5078
5151
  approvalRequests,
5152
+ outcome: approvalRequests.length > 0 ? "pending_approval" : "applied",
5079
5153
  types
5080
5154
  }, [
5081
5155
  applied.changes.length > 0 ? `Applied ${applied.changes.length} change(s).` : null,
@@ -5083,13 +5157,15 @@ function registerPushCommand(program) {
5083
5157
  applied.forced ? "Forced through version conflicts (audited)." : null,
5084
5158
  `Wrote types for ${types.flagCount} flag(s) to ${types.written}`
5085
5159
  ].filter(Boolean).join("\n"));
5160
+ if (approvalRequests.length > 0) process.exitCode = 5;
5086
5161
  });
5087
5162
  }
5088
5163
 
5089
5164
  //#endregion
5090
5165
  //#region src/commands/snapshots.ts
5091
5166
  function registerSnapshotsCommands(program) {
5092
- program.command("snapshots").description("Data-plane snapshot operations").command("publish").description("Materialize the environment snapshot from Postgres and publish to the data plane").action(async (_opts, command) => {
5167
+ const snapshots = program.command("snapshots").description("Data-plane snapshot operations");
5168
+ snapshots.command("publish").description("Materialize the environment snapshot from Postgres and publish to the data plane").action(async (_opts, command) => {
5093
5169
  const runtime = getRuntime(command);
5094
5170
  const client = await createCliApiClient(runtime);
5095
5171
  const { environmentId } = await resolveIds(client, runtime);
@@ -5100,6 +5176,62 @@ function registerSnapshotsCommands(program) {
5100
5176
  }
5101
5177
  console.log(`Published ${result.environmentKey} v${result.version} (${result.flagCount} flags) → ${result.keys.current}`);
5102
5178
  });
5179
+ snapshots.command("outbox").description("List snapshot outbox rows").option("--status <status>", "Filter by status (pending, failed, dead_lettered, …)").action(async (opts, command) => {
5180
+ const runtime = getRuntime(command);
5181
+ const client = await createCliApiClient(runtime);
5182
+ const { environmentId } = await resolveIds(client, runtime);
5183
+ const result = await client.snapshot.listOutbox({
5184
+ environmentId,
5185
+ status: opts.status
5186
+ }).catch(mapApiError);
5187
+ if (runtime.json) {
5188
+ console.log(JSON.stringify(result, null, 2));
5189
+ return;
5190
+ }
5191
+ const rows = Array.isArray(result) ? result : [];
5192
+ if (rows.length === 0) {
5193
+ console.log("No outbox rows.");
5194
+ return;
5195
+ }
5196
+ for (const row of rows) console.log(`#${row.id} v${row.snapshotVersion} ${row.status} attempts=${row.attempts}${row.lastError ? ` — ${row.lastError}` : ""}`);
5197
+ });
5198
+ snapshots.command("requeue").description("Requeue dead-lettered snapshot outbox rows for this environment").action(async (_opts, command) => {
5199
+ const runtime = getRuntime(command);
5200
+ const client = await createCliApiClient(runtime);
5201
+ const { environmentId } = await resolveIds(client, runtime);
5202
+ const result = await client.snapshot.requeue({ environmentId }).catch(mapApiError);
5203
+ if (runtime.json) {
5204
+ console.log(JSON.stringify(result, null, 2));
5205
+ return;
5206
+ }
5207
+ console.log(`Requeued ${result.requeued} dead-lettered row(s).`);
5208
+ });
5209
+ snapshots.command("rebuild").description("Enqueue a snapshot rebuild from Postgres (does not bump version)").option("--project", "Rebuild every environment in the current project").action(async (opts, command) => {
5210
+ const runtime = getRuntime(command);
5211
+ const client = await createCliApiClient(runtime);
5212
+ const result = await (opts.project ? resolveProjectId(client, runtime).then(({ projectId }) => client.snapshot.rebuild({ projectId })) : resolveIds(client, runtime).then(({ environmentId }) => client.snapshot.rebuild({ environmentId }))).catch(mapApiError);
5213
+ if (runtime.json) {
5214
+ console.log(JSON.stringify(result, null, 2));
5215
+ return;
5216
+ }
5217
+ console.log(`Enqueued ${result.enqueued} rebuild job(s).`);
5218
+ });
5219
+ snapshots.command("publications").description("List recorded snapshot publications for this environment").action(async (_opts, command) => {
5220
+ const runtime = getRuntime(command);
5221
+ const client = await createCliApiClient(runtime);
5222
+ const { environmentId } = await resolveIds(client, runtime);
5223
+ const result = await client.snapshot.listPublications({ environmentId }).catch(mapApiError);
5224
+ if (runtime.json) {
5225
+ console.log(JSON.stringify(result, null, 2));
5226
+ return;
5227
+ }
5228
+ const rows = Array.isArray(result) ? result : [];
5229
+ if (rows.length === 0) {
5230
+ console.log("No publications.");
5231
+ return;
5232
+ }
5233
+ for (const row of rows) console.log(`#${row.id} v${row.snapshotVersion} notify=${row.notifyStatus} ${row.contentHash.slice(0, 12)} ${row.createdAt}`);
5234
+ });
5103
5235
  }
5104
5236
 
5105
5237
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipdit/cli",
3
- "version": "0.2.2",
3
+ "version": "0.3.1",
4
4
  "description": "shipd's command-line interface",
5
5
  "repository": {
6
6
  "type": "git",
@@ -19,7 +19,7 @@
19
19
  "dependencies": {
20
20
  "commander": "^14.0.0",
21
21
  "jiti": "^2.5.1",
22
- "shipdit": "0.2.3",
22
+ "shipdit": "0.2.4",
23
23
  "zod": "^4"
24
24
  },
25
25
  "devDependencies": {