@noormdev/sdk 1.0.0 → 1.0.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.
- package/dist/index.js +20 -8
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -4665,12 +4665,24 @@ function getExtension(filename) {
|
|
|
4665
4665
|
|
|
4666
4666
|
// src/core/change/history.ts
|
|
4667
4667
|
var RESET_MARKER = "__reset__";
|
|
4668
|
-
|
|
4668
|
+
var LOCAL_PARSED_TIMESTAMP_DIALECTS = /* @__PURE__ */ new Set(["postgres", "mysql"]);
|
|
4669
|
+
function hydrateDate(value, dialect) {
|
|
4669
4670
|
if (value === null || value === void 0) {
|
|
4670
4671
|
return null;
|
|
4671
4672
|
}
|
|
4672
4673
|
if (value instanceof Date) {
|
|
4673
|
-
|
|
4674
|
+
if (!LOCAL_PARSED_TIMESTAMP_DIALECTS.has(dialect)) {
|
|
4675
|
+
return value;
|
|
4676
|
+
}
|
|
4677
|
+
return new Date(Date.UTC(
|
|
4678
|
+
value.getFullYear(),
|
|
4679
|
+
value.getMonth(),
|
|
4680
|
+
value.getDate(),
|
|
4681
|
+
value.getHours(),
|
|
4682
|
+
value.getMinutes(),
|
|
4683
|
+
value.getSeconds(),
|
|
4684
|
+
value.getMilliseconds()
|
|
4685
|
+
));
|
|
4674
4686
|
}
|
|
4675
4687
|
return /* @__PURE__ */ new Date(`${value.replace(" ", "T")}Z`);
|
|
4676
4688
|
}
|
|
@@ -4728,9 +4740,9 @@ var ChangeHistory = class {
|
|
|
4728
4740
|
return {
|
|
4729
4741
|
name: record.name,
|
|
4730
4742
|
status: record.status,
|
|
4731
|
-
appliedAt: hydrateDate(record.executed_at),
|
|
4743
|
+
appliedAt: hydrateDate(record.executed_at, this.#dialect),
|
|
4732
4744
|
appliedBy: record.executed_by,
|
|
4733
|
-
revertedAt: hydrateDate(revertRecord?.executed_at),
|
|
4745
|
+
revertedAt: hydrateDate(revertRecord?.executed_at, this.#dialect),
|
|
4734
4746
|
errorMessage: record.error_message || null,
|
|
4735
4747
|
appliedHistoryId: record.id
|
|
4736
4748
|
};
|
|
@@ -4760,7 +4772,7 @@ var ChangeHistory = class {
|
|
|
4760
4772
|
statuses.set(record.name, {
|
|
4761
4773
|
name: record.name,
|
|
4762
4774
|
status: record.status,
|
|
4763
|
-
appliedAt: hydrateDate(record.executed_at),
|
|
4775
|
+
appliedAt: hydrateDate(record.executed_at, this.#dialect),
|
|
4764
4776
|
appliedBy: record.executed_by,
|
|
4765
4777
|
revertedAt: null,
|
|
4766
4778
|
// Will be filled in below
|
|
@@ -4777,7 +4789,7 @@ var ChangeHistory = class {
|
|
|
4777
4789
|
for (const revert of reverts) {
|
|
4778
4790
|
if (!seenReverts.has(revert.name) && statuses.has(revert.name)) {
|
|
4779
4791
|
const status = statuses.get(revert.name);
|
|
4780
|
-
status.revertedAt = hydrateDate(revert.executed_at);
|
|
4792
|
+
status.revertedAt = hydrateDate(revert.executed_at, this.#dialect);
|
|
4781
4793
|
seenReverts.add(revert.name);
|
|
4782
4794
|
}
|
|
4783
4795
|
}
|
|
@@ -5244,7 +5256,7 @@ var ChangeHistory = class {
|
|
|
5244
5256
|
status: r.status,
|
|
5245
5257
|
// Non-null: executed_at is NOT NULL with a CURRENT_TIMESTAMP
|
|
5246
5258
|
// default, always populated on write (see createOperation).
|
|
5247
|
-
executedAt: hydrateDate(r.executed_at),
|
|
5259
|
+
executedAt: hydrateDate(r.executed_at, this.#dialect),
|
|
5248
5260
|
executedBy: r.executed_by,
|
|
5249
5261
|
durationMs: r.duration_ms,
|
|
5250
5262
|
errorMessage: r.error_message || null,
|
|
@@ -5296,7 +5308,7 @@ var ChangeHistory = class {
|
|
|
5296
5308
|
status: r.status,
|
|
5297
5309
|
// Non-null: executed_at is NOT NULL with a CURRENT_TIMESTAMP
|
|
5298
5310
|
// default, always populated on write (see createOperation).
|
|
5299
|
-
executedAt: hydrateDate(r.executed_at),
|
|
5311
|
+
executedAt: hydrateDate(r.executed_at, this.#dialect),
|
|
5300
5312
|
executedBy: r.executed_by,
|
|
5301
5313
|
durationMs: r.duration_ms,
|
|
5302
5314
|
errorMessage: r.error_message || null,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noormdev/sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Database schema & changeset manager SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
|
-
"
|
|
12
|
-
"
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
@@ -56,6 +56,6 @@
|
|
|
56
56
|
"license": "MIT",
|
|
57
57
|
"repository": {
|
|
58
58
|
"type": "git",
|
|
59
|
-
"url": "https://github.com/noormdev/noorm"
|
|
59
|
+
"url": "git+https://github.com/noormdev/noorm.git"
|
|
60
60
|
}
|
|
61
61
|
}
|