@deslop/auth 0.1.1331 → 0.1.1333
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/server.js +117 -1
- package/package.json +2 -2
package/dist/server.js
CHANGED
|
@@ -5701,6 +5701,22 @@ const seconds = (seconds) => make$91(seconds * 1e3);
|
|
|
5701
5701
|
*/
|
|
5702
5702
|
const minutes = (minutes) => make$91(minutes * 6e4);
|
|
5703
5703
|
/**
|
|
5704
|
+
* Creates a Duration from hours.
|
|
5705
|
+
*
|
|
5706
|
+
* **Example** (Creating durations from hours)
|
|
5707
|
+
*
|
|
5708
|
+
* ```ts import.meta.vitest
|
|
5709
|
+
* import { Duration } from "effect"
|
|
5710
|
+
*
|
|
5711
|
+
* Duration.toMillis(Duration.hours(2)) // => 7_200_000
|
|
5712
|
+
* ```
|
|
5713
|
+
*
|
|
5714
|
+
* @stability stable
|
|
5715
|
+
* @category constructors
|
|
5716
|
+
* @since 2.0.0
|
|
5717
|
+
*/
|
|
5718
|
+
const hours = (hours) => make$91(hours * 36e5);
|
|
5719
|
+
/**
|
|
5704
5720
|
* Converts a Duration to milliseconds.
|
|
5705
5721
|
*
|
|
5706
5722
|
* **Example** (Converting durations to milliseconds)
|
|
@@ -16264,6 +16280,15 @@ const retry$1 = /*#__PURE__*/ dual(2, (self, options) => {
|
|
|
16264
16280
|
const schedule = typeof options === "function" ? options(identity) : isSchedule(options) ? options : buildFromOptions(options);
|
|
16265
16281
|
return retryOrElse(self, schedule, fail$10);
|
|
16266
16282
|
});
|
|
16283
|
+
/** @internal */
|
|
16284
|
+
const scheduleFrom$1 = /*#__PURE__*/ dual(3, (self, initial, schedule) => flatMap$5(toStepWithMetadata(schedule), (step) => {
|
|
16285
|
+
const loop = (input) => matchEffect$1(step(input), {
|
|
16286
|
+
onSuccess: (meta) => flatMap$5(provideService$3(self, CurrentMetadata, meta), loop),
|
|
16287
|
+
onFailure: failCause$6,
|
|
16288
|
+
onDone: succeed$9
|
|
16289
|
+
});
|
|
16290
|
+
return loop(initial);
|
|
16291
|
+
}));
|
|
16267
16292
|
const passthroughForever = /*#__PURE__*/ passthrough$2(forever$1);
|
|
16268
16293
|
/** @internal */
|
|
16269
16294
|
const buildFromOptions = (options) => {
|
|
@@ -20501,6 +20526,88 @@ const forever = forever$2;
|
|
|
20501
20526
|
*/
|
|
20502
20527
|
const repeat = repeat$1;
|
|
20503
20528
|
/**
|
|
20529
|
+
* Runs an effect repeatedly according to a schedule and returns the schedule's
|
|
20530
|
+
* final output.
|
|
20531
|
+
*
|
|
20532
|
+
* **When to use**
|
|
20533
|
+
*
|
|
20534
|
+
* Use to rerun a successful effect according to a `Schedule` when the schedule
|
|
20535
|
+
* does not need a custom initial input.
|
|
20536
|
+
*
|
|
20537
|
+
* **Details**
|
|
20538
|
+
*
|
|
20539
|
+
* The schedule is first stepped with `undefined`. After each successful
|
|
20540
|
+
* execution, the effect's success value is fed to the schedule to decide
|
|
20541
|
+
* whether to run again. The returned effect fails if the effect or schedule
|
|
20542
|
+
* fails, and otherwise succeeds with the schedule output when the schedule
|
|
20543
|
+
* completes.
|
|
20544
|
+
*
|
|
20545
|
+
* **Example** (Scheduling repeated execution)
|
|
20546
|
+
*
|
|
20547
|
+
* ```ts import.meta.vitest
|
|
20548
|
+
* import { Effect, Schedule } from "effect"
|
|
20549
|
+
* const output: Array<unknown> = []
|
|
20550
|
+
*
|
|
20551
|
+
* const task = Effect.gen(function*() {
|
|
20552
|
+
* yield* Effect.sync(() => { output.push("Task executing...") })
|
|
20553
|
+
* return 1
|
|
20554
|
+
* })
|
|
20555
|
+
*
|
|
20556
|
+
* const program = Effect.schedule(task, Schedule.recurs(2))
|
|
20557
|
+
*
|
|
20558
|
+
* void output.push(Effect.runSync(program))
|
|
20559
|
+
* output // => ["Task executing...", "Task executing...", 2]
|
|
20560
|
+
* ```
|
|
20561
|
+
*
|
|
20562
|
+
* @see {@link scheduleFrom} for a variant that allows the schedule's decision
|
|
20563
|
+
* to depend on the result of this effect.
|
|
20564
|
+
*
|
|
20565
|
+
* @stability stable
|
|
20566
|
+
* @category repetition
|
|
20567
|
+
* @since 2.0.0
|
|
20568
|
+
*/
|
|
20569
|
+
const schedule = /*#__PURE__*/ dual(2, (self, schedule) => scheduleFrom(self, void 0, schedule));
|
|
20570
|
+
/**
|
|
20571
|
+
* Runs an effect repeatedly according to a schedule that is initialized with a
|
|
20572
|
+
* specific schedule input.
|
|
20573
|
+
*
|
|
20574
|
+
* **Details**
|
|
20575
|
+
*
|
|
20576
|
+
* `initial` is passed to the schedule before the first execution, not to the
|
|
20577
|
+
* effect itself. After each successful execution, the effect's success value is
|
|
20578
|
+
* fed back into the schedule to decide whether to continue. The returned effect
|
|
20579
|
+
* succeeds with the schedule output when the schedule completes and fails if
|
|
20580
|
+
* the effect or schedule fails.
|
|
20581
|
+
*
|
|
20582
|
+
* **Example** (Scheduling from an initial value)
|
|
20583
|
+
*
|
|
20584
|
+
* ```ts import.meta.vitest
|
|
20585
|
+
* import { Effect, Schedule } from "effect"
|
|
20586
|
+
* const output: Array<unknown> = []
|
|
20587
|
+
*
|
|
20588
|
+
* const task = (input: number) =>
|
|
20589
|
+
* Effect.gen(function*() {
|
|
20590
|
+
* yield* Effect.sync(() => { output.push(`Processing: ${input}`) })
|
|
20591
|
+
* return input + 1
|
|
20592
|
+
* })
|
|
20593
|
+
*
|
|
20594
|
+
* // Start with 0, repeat 3 times
|
|
20595
|
+
* const program = Effect.scheduleFrom(
|
|
20596
|
+
* task(0),
|
|
20597
|
+
* 0,
|
|
20598
|
+
* Schedule.recurs(2)
|
|
20599
|
+
* )
|
|
20600
|
+
*
|
|
20601
|
+
* void output.push(Effect.runSync(program))
|
|
20602
|
+
* output // => ["Processing: 0", "Processing: 0", 2]
|
|
20603
|
+
* ```
|
|
20604
|
+
*
|
|
20605
|
+
* @stability stable
|
|
20606
|
+
* @category repetition
|
|
20607
|
+
* @since 2.0.0
|
|
20608
|
+
*/
|
|
20609
|
+
const scheduleFrom = scheduleFrom$1;
|
|
20610
|
+
/**
|
|
20504
20611
|
* Enables or disables tracing for spans created by the given effect.
|
|
20505
20612
|
*
|
|
20506
20613
|
* **Details**
|
|
@@ -108584,6 +108691,15 @@ const retiredSessions = effectDiscard(make$31({})({
|
|
|
108584
108691
|
loader: fromRecord({ "0002_drop_sessions": flatMap$3(SqlClient, (sql) => sql`DROP TABLE IF EXISTS sessions`) }),
|
|
108585
108692
|
table: "sessions_migrations"
|
|
108586
108693
|
}));
|
|
108694
|
+
const tuned = effectDiscard(gen(function* () {
|
|
108695
|
+
const sql = yield* SqlClient;
|
|
108696
|
+
yield* sql`PRAGMA auto_vacuum = INCREMENTAL`;
|
|
108697
|
+
yield* sql`PRAGMA synchronous = NORMAL`;
|
|
108698
|
+
yield* pipe(sql`PRAGMA incremental_vacuum`, andThen(sql`PRAGMA optimize`), withSpan("Store.maintain"), ignore$1({
|
|
108699
|
+
log: "Warn",
|
|
108700
|
+
message: "The database could not be compacted"
|
|
108701
|
+
}), schedule(spaced(hours(1))), forkScoped);
|
|
108702
|
+
}));
|
|
108587
108703
|
function layerDataStore(directory) {
|
|
108588
108704
|
return unwrap$7(gen(function* () {
|
|
108589
108705
|
const fs = yield* FileSystem;
|
|
@@ -108596,7 +108712,7 @@ function layerDataStore(directory) {
|
|
|
108596
108712
|
flag: "a",
|
|
108597
108713
|
mode: 384
|
|
108598
108714
|
});
|
|
108599
|
-
return provideMerge(retiredSessions, merge$3(layer({ filename }), layer$19));
|
|
108715
|
+
return provideMerge(retiredSessions, provideMerge(tuned, merge$3(layer({ filename }), layer$19)));
|
|
108600
108716
|
}));
|
|
108601
108717
|
}
|
|
108602
108718
|
// ../../packages/runtime/src/server/process.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deslop/auth",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1333",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/MP281X/deslop.git",
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"engines": {
|
|
34
34
|
"node": ">=26"
|
|
35
35
|
},
|
|
36
|
-
"fingerprint": "
|
|
36
|
+
"fingerprint": "62c78a16ea5453889a5589ddeba107bffb8020a075933682719fb133711780ea"
|
|
37
37
|
}
|