@rebasepro/server-postgres 0.17.3 → 0.18.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/LICENSE +0 -1
- package/README.md +31 -0
- package/dist/BranchService-ByLfM_Tt.js +360 -0
- package/dist/BranchService-ByLfM_Tt.js.map +1 -0
- package/dist/__vite-browser-external-BnuHet1e.js +46 -0
- package/dist/__vite-browser-external-BnuHet1e.js.map +1 -0
- package/dist/arg-Dni7MzLB.js +87 -0
- package/dist/arg-Dni7MzLB.js.map +1 -0
- package/dist/auth-users-columns-D2LBFrMH.js +116 -0
- package/dist/auth-users-columns-D2LBFrMH.js.map +1 -0
- package/dist/backup-argv.d.ts +19 -0
- package/dist/backup-cli-oM9WQVlV.js +408 -0
- package/dist/backup-cli-oM9WQVlV.js.map +1 -0
- package/dist/backup-service-Br3tqwsy.js +715 -0
- package/dist/backup-service-Br3tqwsy.js.map +1 -0
- package/dist/branch-argv.d.ts +28 -0
- package/dist/branch-prune.d.ts +77 -0
- package/dist/cli-collections-path.d.ts +31 -0
- package/dist/cli-errors-DxN4yzdH.js +657 -0
- package/dist/cli-errors-DxN4yzdH.js.map +1 -0
- package/dist/cli-errors.d.ts +123 -0
- package/dist/cli-flags.d.ts +101 -0
- package/dist/cli-helpers.d.ts +94 -10
- package/dist/cli-output-CNdMql-L.js +47 -0
- package/dist/cli-output-CNdMql-L.js.map +1 -0
- package/dist/cli.js +2020 -0
- package/dist/cli.js.map +1 -0
- package/dist/collection-index-BHgT_TKd.js +276 -0
- package/dist/collection-index-BHgT_TKd.js.map +1 -0
- package/dist/{collections-schema-version-BMeu3cgv.js → collections-schema-version-T6cGvrDi.js} +1 -2
- package/dist/{collections-schema-version-BMeu3cgv.js.map → collections-schema-version-T6cGvrDi.js.map} +1 -1
- package/dist/{connection-GOKU3Hu5.js → databasePoolManager-Bj5FbeAs.js} +112 -40
- package/dist/databasePoolManager-Bj5FbeAs.js.map +1 -0
- package/dist/databasePoolManager.d.ts +27 -0
- package/dist/doctor-D7HWmGzs.js +974 -0
- package/dist/doctor-D7HWmGzs.js.map +1 -0
- package/dist/{ensure-collection-policies-UCqgv_8c.js → ensure-collection-policies-2c2NV8zX.js} +7 -27
- package/dist/ensure-collection-policies-2c2NV8zX.js.map +1 -0
- package/dist/ensure-collection-tables-D4wJzM4y.js +820 -0
- package/dist/ensure-collection-tables-D4wJzM4y.js.map +1 -0
- package/dist/ensure-tables-CIojK-Rx.js +650 -0
- package/dist/ensure-tables-CIojK-Rx.js.map +1 -0
- package/dist/generate-drizzle-schema-CwEgVyjO.js +123 -0
- package/dist/generate-drizzle-schema-CwEgVyjO.js.map +1 -0
- package/dist/generate-drizzle-schema-logic-so2Z_lyC.js +528 -0
- package/dist/generate-drizzle-schema-logic-so2Z_lyC.js.map +1 -0
- package/dist/{ensure-collection-tables-DgVixhX3.js → generate-postgres-ddl-logic-CtnpIBVv.js} +126 -984
- package/dist/generate-postgres-ddl-logic-CtnpIBVv.js.map +1 -0
- package/dist/generated-schema-staleness-DQdfJl2A.js +157 -0
- package/dist/generated-schema-staleness-DQdfJl2A.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.es.js +7423 -1133
- package/dist/index.es.js.map +1 -1
- package/dist/introspect-db-logic-C6LQdTxj.js +1378 -0
- package/dist/introspect-db-logic-C6LQdTxj.js.map +1 -0
- package/dist/policy-drift-kNJ6X2Uj.js +313 -0
- package/dist/policy-drift-kNJ6X2Uj.js.map +1 -0
- package/dist/{backup-service-DCk7KhhL.js → rls-bootstrap-sql-DLDnUjtx.js} +737 -2689
- package/dist/rls-bootstrap-sql-DLDnUjtx.js.map +1 -0
- package/dist/{rls-enforcement-DvAbL9YJ.js → rls-enforcement-DeYEjYLt.js} +65 -190
- package/dist/rls-enforcement-DeYEjYLt.js.map +1 -0
- package/dist/schema/bin/generate-drizzle-schema.d.ts +1 -0
- package/dist/schema/bin/generate-postgres-ddl.d.ts +1 -0
- package/dist/schema/column-type-drift.d.ts +79 -0
- package/dist/schema/doctor-cli.js +129 -0
- package/dist/schema/doctor-cli.js.map +1 -0
- package/dist/schema/doctor.d.ts +42 -0
- package/dist/schema/ensure-collection-tables.d.ts +90 -0
- package/dist/schema/generate-drizzle-schema.d.ts +1 -1
- package/dist/schema/generate-drizzle-schema.js +24 -0
- package/dist/schema/generate-drizzle-schema.js.map +1 -0
- package/dist/schema/generate-next-step.d.ts +30 -0
- package/dist/schema/generate-postgres-ddl-logic.d.ts +28 -0
- package/dist/schema/generate-postgres-ddl.d.ts +1 -1
- package/dist/schema/generate-postgres-ddl.js +138 -0
- package/dist/schema/generate-postgres-ddl.js.map +1 -0
- package/dist/schema/generated-schema-staleness.d.ts +37 -0
- package/dist/schema/introspect-db-queries.d.ts +34 -0
- package/dist/schema/introspect-db.js +866 -0
- package/dist/schema/introspect-db.js.map +1 -0
- package/dist/security/rls-enforcement.d.ts +63 -2
- package/dist/services/BranchService.d.ts +86 -1
- package/dist/services/collection-helpers.d.ts +1 -1
- package/dist/services/realtimeService.d.ts +30 -2
- package/dist/services/row-pipeline.d.ts +12 -1
- package/dist/source-Br7L7GOI.js +410 -0
- package/dist/source-Br7L7GOI.js.map +1 -0
- package/dist/utils/pg-error-utils.d.ts +3 -1
- package/dist/utils/pg-numeric-number-patch.d.ts +31 -0
- package/dist/vector-index-DkWxm2de.js +309 -0
- package/dist/vector-index-DkWxm2de.js.map +1 -0
- package/package.json +32 -27
- package/dist/backup-service-DCk7KhhL.js.map +0 -1
- package/dist/collection-index-BRUg10H5.js +0 -5690
- package/dist/collection-index-BRUg10H5.js.map +0 -1
- package/dist/connection-GOKU3Hu5.js.map +0 -1
- package/dist/ensure-collection-policies-UCqgv_8c.js.map +0 -1
- package/dist/ensure-collection-tables-DgVixhX3.js.map +0 -1
- package/dist/rls-bootstrap-sql-B5C9LoJ6.js +0 -244
- package/dist/rls-bootstrap-sql-B5C9LoJ6.js.map +0 -1
- package/dist/rls-enforcement-DvAbL9YJ.js.map +0 -1
- package/dist/src-DiB5RP2Z.js +0 -541
- package/dist/src-DiB5RP2Z.js.map +0 -1
- package/dist/websocket-BZ4H5wUz.js +0 -8198
- package/dist/websocket-BZ4H5wUz.js.map +0 -1
- package/src/PostgresAdapter.ts +0 -91
- package/src/PostgresBackendDriver.ts +0 -1857
- package/src/PostgresBootstrapper.ts +0 -1157
- package/src/auth/ensure-tables.ts +0 -896
- package/src/auth/schema-version.ts +0 -260
- package/src/auth/services.ts +0 -1610
- package/src/backup/backup-cli.ts +0 -520
- package/src/backup/backup-cron.ts +0 -212
- package/src/backup/backup-logic.ts +0 -93
- package/src/backup/backup-service.ts +0 -485
- package/src/backup/index.ts +0 -12
- package/src/backup/pg-tools.ts +0 -403
- package/src/backup/retention.ts +0 -86
- package/src/cli-errors.ts +0 -265
- package/src/cli-helpers.ts +0 -569
- package/src/cli-output.ts +0 -43
- package/src/cli.ts +0 -1339
- package/src/collections/PostgresCollectionRegistry.ts +0 -108
- package/src/collections/buildRegistry.ts +0 -68
- package/src/collections/validate-relations.ts +0 -402
- package/src/connection.ts +0 -333
- package/src/data-transformer.ts +0 -845
- package/src/databasePoolManager.ts +0 -95
- package/src/history/HistoryService.ts +0 -254
- package/src/history/ensure-history-table.ts +0 -53
- package/src/index.ts +0 -19
- package/src/interfaces.ts +0 -60
- package/src/module-dir.ts +0 -7
- package/src/schema/atlas-argv.ts +0 -94
- package/src/schema/auth-schema.ts +0 -298
- package/src/schema/auth-users-columns.ts +0 -131
- package/src/schema/carved-out-migration.ts +0 -404
- package/src/schema/classify-change.ts +0 -436
- package/src/schema/collection-index.ts +0 -427
- package/src/schema/collections-schema-version.ts +0 -103
- package/src/schema/destructive-sql.ts +0 -94
- package/src/schema/doctor-cli.ts +0 -66
- package/src/schema/doctor-policy-checks.ts +0 -105
- package/src/schema/doctor.ts +0 -837
- package/src/schema/drizzle-ddl.ts +0 -33
- package/src/schema/dynamic-tables.test.ts +0 -302
- package/src/schema/dynamic-tables.ts +0 -293
- package/src/schema/ensure-collection-policies.ts +0 -198
- package/src/schema/ensure-collection-tables.test.ts +0 -518
- package/src/schema/ensure-collection-tables.ts +0 -1267
- package/src/schema/generate-drizzle-schema-logic.ts +0 -957
- package/src/schema/generate-drizzle-schema.ts +0 -143
- package/src/schema/generate-postgres-ddl-logic.ts +0 -1339
- package/src/schema/generate-postgres-ddl.ts +0 -180
- package/src/schema/generate-schema-commit.ts +0 -267
- package/src/schema/generated-schema-staleness.ts +0 -284
- package/src/schema/introspect-db-constraints.ts +0 -385
- package/src/schema/introspect-db-inference.ts +0 -255
- package/src/schema/introspect-db-logic.ts +0 -1387
- package/src/schema/introspect-db-naming.ts +0 -15
- package/src/schema/introspect-db-project.ts +0 -78
- package/src/schema/introspect-db-queries.ts +0 -326
- package/src/schema/introspect-db-structure.ts +0 -670
- package/src/schema/introspect-db-types.ts +0 -56
- package/src/schema/introspect-db.ts +0 -257
- package/src/schema/introspect-runtime.test.ts +0 -260
- package/src/schema/introspect-runtime.ts +0 -327
- package/src/schema/non-sql-collections.test.ts +0 -131
- package/src/schema/rls-bootstrap-sql.ts +0 -288
- package/src/schema/search-column.ts +0 -643
- package/src/schema/test-schema.ts +0 -11
- package/src/schema/vector-index.ts +0 -491
- package/src/security/anonymous-grants.test.ts +0 -73
- package/src/security/policy-drift.test.ts +0 -435
- package/src/security/policy-drift.ts +0 -473
- package/src/security/rls-enforcement.ts +0 -505
- package/src/services/BranchService.ts +0 -326
- package/src/services/FetchService.ts +0 -2115
- package/src/services/PersistService.ts +0 -557
- package/src/services/RelationService.ts +0 -978
- package/src/services/RelationWriteService.ts +0 -653
- package/src/services/cdc/CdcListener.ts +0 -103
- package/src/services/cdc/junction-tables.ts +0 -91
- package/src/services/cdc/trigger-cdc.ts +0 -173
- package/src/services/channel-bus/ChannelBus.ts +0 -44
- package/src/services/channel-bus/PostgresChannelBus.ts +0 -299
- package/src/services/channel-bus/index.ts +0 -114
- package/src/services/channel-history.ts +0 -424
- package/src/services/channel-presence.ts +0 -185
- package/src/services/collection-helpers.ts +0 -420
- package/src/services/dataService.ts +0 -256
- package/src/services/index.ts +0 -14
- package/src/services/junction-writes.ts +0 -295
- package/src/services/nested-path.ts +0 -145
- package/src/services/pg-notify-listener.ts +0 -151
- package/src/services/realtimeService.ts +0 -2545
- package/src/services/row-pipeline.ts +0 -240
- package/src/services/write-denial.ts +0 -55
- package/src/types.ts +0 -4
- package/src/utils/connection-string.ts +0 -58
- package/src/utils/drizzle-conditions.ts +0 -2743
- package/src/utils/pg-array-null-patch.ts +0 -42
- package/src/utils/pg-error-utils.ts +0 -391
- package/src/websocket.ts +0 -855
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from "module";
|
|
2
|
+
__createRequire(import.meta.url);
|
|
3
|
+
import process from "node:process";
|
|
4
|
+
import tty from "node:tty";
|
|
5
|
+
import os from "node:os";
|
|
6
|
+
//#region ../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
7
|
+
var ANSI_BACKGROUND_OFFSET = 10;
|
|
8
|
+
var wrapAnsi16 = (offset = 0) => (code) => `\u001B[${code + offset}m`;
|
|
9
|
+
var wrapAnsi256 = (offset = 0) => (code) => `\u001B[${38 + offset};5;${code}m`;
|
|
10
|
+
var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\u001B[${38 + offset};2;${red};${green};${blue}m`;
|
|
11
|
+
var styles$1 = {
|
|
12
|
+
modifier: {
|
|
13
|
+
reset: [0, 0],
|
|
14
|
+
bold: [1, 22],
|
|
15
|
+
dim: [2, 22],
|
|
16
|
+
italic: [3, 23],
|
|
17
|
+
underline: [4, 24],
|
|
18
|
+
overline: [53, 55],
|
|
19
|
+
inverse: [7, 27],
|
|
20
|
+
hidden: [8, 28],
|
|
21
|
+
strikethrough: [9, 29]
|
|
22
|
+
},
|
|
23
|
+
color: {
|
|
24
|
+
black: [30, 39],
|
|
25
|
+
red: [31, 39],
|
|
26
|
+
green: [32, 39],
|
|
27
|
+
yellow: [33, 39],
|
|
28
|
+
blue: [34, 39],
|
|
29
|
+
magenta: [35, 39],
|
|
30
|
+
cyan: [36, 39],
|
|
31
|
+
white: [37, 39],
|
|
32
|
+
blackBright: [90, 39],
|
|
33
|
+
gray: [90, 39],
|
|
34
|
+
grey: [90, 39],
|
|
35
|
+
redBright: [91, 39],
|
|
36
|
+
greenBright: [92, 39],
|
|
37
|
+
yellowBright: [93, 39],
|
|
38
|
+
blueBright: [94, 39],
|
|
39
|
+
magentaBright: [95, 39],
|
|
40
|
+
cyanBright: [96, 39],
|
|
41
|
+
whiteBright: [97, 39]
|
|
42
|
+
},
|
|
43
|
+
bgColor: {
|
|
44
|
+
bgBlack: [40, 49],
|
|
45
|
+
bgRed: [41, 49],
|
|
46
|
+
bgGreen: [42, 49],
|
|
47
|
+
bgYellow: [43, 49],
|
|
48
|
+
bgBlue: [44, 49],
|
|
49
|
+
bgMagenta: [45, 49],
|
|
50
|
+
bgCyan: [46, 49],
|
|
51
|
+
bgWhite: [47, 49],
|
|
52
|
+
bgBlackBright: [100, 49],
|
|
53
|
+
bgGray: [100, 49],
|
|
54
|
+
bgGrey: [100, 49],
|
|
55
|
+
bgRedBright: [101, 49],
|
|
56
|
+
bgGreenBright: [102, 49],
|
|
57
|
+
bgYellowBright: [103, 49],
|
|
58
|
+
bgBlueBright: [104, 49],
|
|
59
|
+
bgMagentaBright: [105, 49],
|
|
60
|
+
bgCyanBright: [106, 49],
|
|
61
|
+
bgWhiteBright: [107, 49]
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
Object.keys(styles$1.modifier);
|
|
65
|
+
var foregroundColorNames = Object.keys(styles$1.color);
|
|
66
|
+
var backgroundColorNames = Object.keys(styles$1.bgColor);
|
|
67
|
+
[...foregroundColorNames, ...backgroundColorNames];
|
|
68
|
+
function assembleStyles() {
|
|
69
|
+
const codes = /* @__PURE__ */ new Map();
|
|
70
|
+
for (const [groupName, group] of Object.entries(styles$1)) {
|
|
71
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
72
|
+
styles$1[styleName] = {
|
|
73
|
+
open: `\u001B[${style[0]}m`,
|
|
74
|
+
close: `\u001B[${style[1]}m`
|
|
75
|
+
};
|
|
76
|
+
group[styleName] = styles$1[styleName];
|
|
77
|
+
codes.set(style[0], style[1]);
|
|
78
|
+
}
|
|
79
|
+
Object.defineProperty(styles$1, groupName, {
|
|
80
|
+
value: group,
|
|
81
|
+
enumerable: false
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
Object.defineProperty(styles$1, "codes", {
|
|
85
|
+
value: codes,
|
|
86
|
+
enumerable: false
|
|
87
|
+
});
|
|
88
|
+
styles$1.color.close = "\x1B[39m";
|
|
89
|
+
styles$1.bgColor.close = "\x1B[49m";
|
|
90
|
+
styles$1.color.ansi = wrapAnsi16();
|
|
91
|
+
styles$1.color.ansi256 = wrapAnsi256();
|
|
92
|
+
styles$1.color.ansi16m = wrapAnsi16m();
|
|
93
|
+
styles$1.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
|
94
|
+
styles$1.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
95
|
+
styles$1.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
96
|
+
Object.defineProperties(styles$1, {
|
|
97
|
+
rgbToAnsi256: {
|
|
98
|
+
value(red, green, blue) {
|
|
99
|
+
if (red === green && green === blue) {
|
|
100
|
+
if (red < 8) return 16;
|
|
101
|
+
if (red > 248) return 231;
|
|
102
|
+
return Math.round((red - 8) / 247 * 24) + 232;
|
|
103
|
+
}
|
|
104
|
+
return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
|
105
|
+
},
|
|
106
|
+
enumerable: false
|
|
107
|
+
},
|
|
108
|
+
hexToRgb: {
|
|
109
|
+
value(hex) {
|
|
110
|
+
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
111
|
+
if (!matches) return [
|
|
112
|
+
0,
|
|
113
|
+
0,
|
|
114
|
+
0
|
|
115
|
+
];
|
|
116
|
+
let [colorString] = matches;
|
|
117
|
+
if (colorString.length === 3) colorString = [...colorString].map((character) => character + character).join("");
|
|
118
|
+
const integer = Number.parseInt(colorString, 16);
|
|
119
|
+
return [
|
|
120
|
+
integer >> 16 & 255,
|
|
121
|
+
integer >> 8 & 255,
|
|
122
|
+
integer & 255
|
|
123
|
+
];
|
|
124
|
+
},
|
|
125
|
+
enumerable: false
|
|
126
|
+
},
|
|
127
|
+
hexToAnsi256: {
|
|
128
|
+
value: (hex) => styles$1.rgbToAnsi256(...styles$1.hexToRgb(hex)),
|
|
129
|
+
enumerable: false
|
|
130
|
+
},
|
|
131
|
+
ansi256ToAnsi: {
|
|
132
|
+
value(code) {
|
|
133
|
+
if (code < 8) return 30 + code;
|
|
134
|
+
if (code < 16) return 90 + (code - 8);
|
|
135
|
+
let red;
|
|
136
|
+
let green;
|
|
137
|
+
let blue;
|
|
138
|
+
if (code >= 232) {
|
|
139
|
+
red = ((code - 232) * 10 + 8) / 255;
|
|
140
|
+
green = red;
|
|
141
|
+
blue = red;
|
|
142
|
+
} else {
|
|
143
|
+
code -= 16;
|
|
144
|
+
const remainder = code % 36;
|
|
145
|
+
red = Math.floor(code / 36) / 5;
|
|
146
|
+
green = Math.floor(remainder / 6) / 5;
|
|
147
|
+
blue = remainder % 6 / 5;
|
|
148
|
+
}
|
|
149
|
+
const value = Math.max(red, green, blue) * 2;
|
|
150
|
+
if (value === 0) return 30;
|
|
151
|
+
let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
|
152
|
+
if (value === 2) result += 60;
|
|
153
|
+
return result;
|
|
154
|
+
},
|
|
155
|
+
enumerable: false
|
|
156
|
+
},
|
|
157
|
+
rgbToAnsi: {
|
|
158
|
+
value: (red, green, blue) => styles$1.ansi256ToAnsi(styles$1.rgbToAnsi256(red, green, blue)),
|
|
159
|
+
enumerable: false
|
|
160
|
+
},
|
|
161
|
+
hexToAnsi: {
|
|
162
|
+
value: (hex) => styles$1.ansi256ToAnsi(styles$1.hexToAnsi256(hex)),
|
|
163
|
+
enumerable: false
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
return styles$1;
|
|
167
|
+
}
|
|
168
|
+
var ansiStyles = assembleStyles();
|
|
169
|
+
//#endregion
|
|
170
|
+
//#region ../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/supports-color/index.js
|
|
171
|
+
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process.argv) {
|
|
172
|
+
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
173
|
+
const position = argv.indexOf(prefix + flag);
|
|
174
|
+
const terminatorPosition = argv.indexOf("--");
|
|
175
|
+
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
176
|
+
}
|
|
177
|
+
var { env } = process;
|
|
178
|
+
var flagForceColor;
|
|
179
|
+
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) flagForceColor = 0;
|
|
180
|
+
else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) flagForceColor = 1;
|
|
181
|
+
function envForceColor() {
|
|
182
|
+
if ("FORCE_COLOR" in env) {
|
|
183
|
+
if (env.FORCE_COLOR === "true") return 1;
|
|
184
|
+
if (env.FORCE_COLOR === "false") return 0;
|
|
185
|
+
return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
function translateLevel(level) {
|
|
189
|
+
if (level === 0) return false;
|
|
190
|
+
return {
|
|
191
|
+
level,
|
|
192
|
+
hasBasic: true,
|
|
193
|
+
has256: level >= 2,
|
|
194
|
+
has16m: level >= 3
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
198
|
+
const noFlagForceColor = envForceColor();
|
|
199
|
+
if (noFlagForceColor !== void 0) flagForceColor = noFlagForceColor;
|
|
200
|
+
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
201
|
+
if (forceColor === 0) return 0;
|
|
202
|
+
if (sniffFlags) {
|
|
203
|
+
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) return 3;
|
|
204
|
+
if (hasFlag("color=256")) return 2;
|
|
205
|
+
}
|
|
206
|
+
if ("TF_BUILD" in env && "AGENT_NAME" in env) return 1;
|
|
207
|
+
if (haveStream && !streamIsTTY && forceColor === void 0) return 0;
|
|
208
|
+
const min = forceColor || 0;
|
|
209
|
+
if (env.TERM === "dumb") return min;
|
|
210
|
+
if (process.platform === "win32") {
|
|
211
|
+
const osRelease = os.release().split(".");
|
|
212
|
+
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
213
|
+
return 1;
|
|
214
|
+
}
|
|
215
|
+
if ("CI" in env) {
|
|
216
|
+
if ([
|
|
217
|
+
"GITHUB_ACTIONS",
|
|
218
|
+
"GITEA_ACTIONS",
|
|
219
|
+
"CIRCLECI"
|
|
220
|
+
].some((key) => key in env)) return 3;
|
|
221
|
+
if ([
|
|
222
|
+
"TRAVIS",
|
|
223
|
+
"APPVEYOR",
|
|
224
|
+
"GITLAB_CI",
|
|
225
|
+
"BUILDKITE",
|
|
226
|
+
"DRONE"
|
|
227
|
+
].some((sign) => sign in env) || env.CI_NAME === "codeship") return 1;
|
|
228
|
+
return min;
|
|
229
|
+
}
|
|
230
|
+
if ("TEAMCITY_VERSION" in env) return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
231
|
+
if (env.COLORTERM === "truecolor") return 3;
|
|
232
|
+
if (env.TERM === "xterm-kitty") return 3;
|
|
233
|
+
if (env.TERM === "xterm-ghostty") return 3;
|
|
234
|
+
if (env.TERM === "wezterm") return 3;
|
|
235
|
+
if ("TERM_PROGRAM" in env) {
|
|
236
|
+
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
237
|
+
switch (env.TERM_PROGRAM) {
|
|
238
|
+
case "iTerm.app": return version >= 3 ? 3 : 2;
|
|
239
|
+
case "Apple_Terminal": return 2;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
if (/-256(color)?$/i.test(env.TERM)) return 2;
|
|
243
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) return 1;
|
|
244
|
+
if ("COLORTERM" in env) return 1;
|
|
245
|
+
return min;
|
|
246
|
+
}
|
|
247
|
+
function createSupportsColor(stream, options = {}) {
|
|
248
|
+
return translateLevel(_supportsColor(stream, {
|
|
249
|
+
streamIsTTY: stream && stream.isTTY,
|
|
250
|
+
...options
|
|
251
|
+
}));
|
|
252
|
+
}
|
|
253
|
+
var supportsColor = {
|
|
254
|
+
stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
|
|
255
|
+
stderr: createSupportsColor({ isTTY: tty.isatty(2) })
|
|
256
|
+
};
|
|
257
|
+
//#endregion
|
|
258
|
+
//#region ../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/utilities.js
|
|
259
|
+
function stringReplaceAll(string, substring, replacer) {
|
|
260
|
+
let index = string.indexOf(substring);
|
|
261
|
+
if (index === -1) return string;
|
|
262
|
+
const substringLength = substring.length;
|
|
263
|
+
let endIndex = 0;
|
|
264
|
+
let returnValue = "";
|
|
265
|
+
do {
|
|
266
|
+
returnValue += string.slice(endIndex, index) + substring + replacer;
|
|
267
|
+
endIndex = index + substringLength;
|
|
268
|
+
index = string.indexOf(substring, endIndex);
|
|
269
|
+
} while (index !== -1);
|
|
270
|
+
returnValue += string.slice(endIndex);
|
|
271
|
+
return returnValue;
|
|
272
|
+
}
|
|
273
|
+
function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
|
|
274
|
+
let endIndex = 0;
|
|
275
|
+
let returnValue = "";
|
|
276
|
+
do {
|
|
277
|
+
const gotCR = string[index - 1] === "\r";
|
|
278
|
+
returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
279
|
+
endIndex = index + 1;
|
|
280
|
+
index = string.indexOf("\n", endIndex);
|
|
281
|
+
} while (index !== -1);
|
|
282
|
+
returnValue += string.slice(endIndex);
|
|
283
|
+
return returnValue;
|
|
284
|
+
}
|
|
285
|
+
//#endregion
|
|
286
|
+
//#region ../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/index.js
|
|
287
|
+
var { stdout: stdoutColor, stderr: stderrColor } = supportsColor;
|
|
288
|
+
var GENERATOR = Symbol("GENERATOR");
|
|
289
|
+
var STYLER = Symbol("STYLER");
|
|
290
|
+
var IS_EMPTY = Symbol("IS_EMPTY");
|
|
291
|
+
var levelMapping = [
|
|
292
|
+
"ansi",
|
|
293
|
+
"ansi",
|
|
294
|
+
"ansi256",
|
|
295
|
+
"ansi16m"
|
|
296
|
+
];
|
|
297
|
+
var styles = Object.create(null);
|
|
298
|
+
var applyOptions = (object, options = {}) => {
|
|
299
|
+
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) throw new Error("The `level` option should be an integer from 0 to 3");
|
|
300
|
+
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
301
|
+
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
302
|
+
};
|
|
303
|
+
var chalkFactory = (options) => {
|
|
304
|
+
const chalk = (...strings) => strings.join(" ");
|
|
305
|
+
applyOptions(chalk, options);
|
|
306
|
+
Object.setPrototypeOf(chalk, createChalk.prototype);
|
|
307
|
+
return chalk;
|
|
308
|
+
};
|
|
309
|
+
function createChalk(options) {
|
|
310
|
+
return chalkFactory(options);
|
|
311
|
+
}
|
|
312
|
+
Object.setPrototypeOf(createChalk.prototype, Function.prototype);
|
|
313
|
+
for (const [styleName, style] of Object.entries(ansiStyles)) styles[styleName] = { get() {
|
|
314
|
+
const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
|
|
315
|
+
Object.defineProperty(this, styleName, { value: builder });
|
|
316
|
+
return builder;
|
|
317
|
+
} };
|
|
318
|
+
styles.visible = { get() {
|
|
319
|
+
const builder = createBuilder(this, this[STYLER], true);
|
|
320
|
+
Object.defineProperty(this, "visible", { value: builder });
|
|
321
|
+
return builder;
|
|
322
|
+
} };
|
|
323
|
+
var getModelAnsi = (model, level, type, ...arguments_) => {
|
|
324
|
+
if (model === "rgb") {
|
|
325
|
+
if (level === "ansi16m") return ansiStyles[type].ansi16m(...arguments_);
|
|
326
|
+
if (level === "ansi256") return ansiStyles[type].ansi256(ansiStyles.rgbToAnsi256(...arguments_));
|
|
327
|
+
return ansiStyles[type].ansi(ansiStyles.rgbToAnsi(...arguments_));
|
|
328
|
+
}
|
|
329
|
+
if (model === "hex") return getModelAnsi("rgb", level, type, ...ansiStyles.hexToRgb(...arguments_));
|
|
330
|
+
return ansiStyles[type][model](...arguments_);
|
|
331
|
+
};
|
|
332
|
+
for (const model of [
|
|
333
|
+
"rgb",
|
|
334
|
+
"hex",
|
|
335
|
+
"ansi256"
|
|
336
|
+
]) {
|
|
337
|
+
styles[model] = { get() {
|
|
338
|
+
const { level } = this;
|
|
339
|
+
return function(...arguments_) {
|
|
340
|
+
const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansiStyles.color.close, this[STYLER]);
|
|
341
|
+
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
342
|
+
};
|
|
343
|
+
} };
|
|
344
|
+
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
345
|
+
styles[bgModel] = { get() {
|
|
346
|
+
const { level } = this;
|
|
347
|
+
return function(...arguments_) {
|
|
348
|
+
const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansiStyles.bgColor.close, this[STYLER]);
|
|
349
|
+
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
350
|
+
};
|
|
351
|
+
} };
|
|
352
|
+
}
|
|
353
|
+
var proto = Object.defineProperties(() => {}, {
|
|
354
|
+
...styles,
|
|
355
|
+
level: {
|
|
356
|
+
enumerable: true,
|
|
357
|
+
get() {
|
|
358
|
+
return this[GENERATOR].level;
|
|
359
|
+
},
|
|
360
|
+
set(level) {
|
|
361
|
+
this[GENERATOR].level = level;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
});
|
|
365
|
+
var createStyler = (open, close, parent) => {
|
|
366
|
+
let openAll;
|
|
367
|
+
let closeAll;
|
|
368
|
+
if (parent === void 0) {
|
|
369
|
+
openAll = open;
|
|
370
|
+
closeAll = close;
|
|
371
|
+
} else {
|
|
372
|
+
openAll = parent.openAll + open;
|
|
373
|
+
closeAll = close + parent.closeAll;
|
|
374
|
+
}
|
|
375
|
+
return {
|
|
376
|
+
open,
|
|
377
|
+
close,
|
|
378
|
+
openAll,
|
|
379
|
+
closeAll,
|
|
380
|
+
parent
|
|
381
|
+
};
|
|
382
|
+
};
|
|
383
|
+
var createBuilder = (self, _styler, _isEmpty) => {
|
|
384
|
+
const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
385
|
+
Object.setPrototypeOf(builder, proto);
|
|
386
|
+
builder[GENERATOR] = self;
|
|
387
|
+
builder[STYLER] = _styler;
|
|
388
|
+
builder[IS_EMPTY] = _isEmpty;
|
|
389
|
+
return builder;
|
|
390
|
+
};
|
|
391
|
+
var applyStyle = (self, string) => {
|
|
392
|
+
if (self.level <= 0 || !string) return self[IS_EMPTY] ? "" : string;
|
|
393
|
+
let styler = self[STYLER];
|
|
394
|
+
if (styler === void 0) return string;
|
|
395
|
+
const { openAll, closeAll } = styler;
|
|
396
|
+
if (string.includes("\x1B")) while (styler !== void 0) {
|
|
397
|
+
string = stringReplaceAll(string, styler.close, styler.open);
|
|
398
|
+
styler = styler.parent;
|
|
399
|
+
}
|
|
400
|
+
const lfIndex = string.indexOf("\n");
|
|
401
|
+
if (lfIndex !== -1) string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
|
402
|
+
return openAll + string + closeAll;
|
|
403
|
+
};
|
|
404
|
+
Object.defineProperties(createChalk.prototype, styles);
|
|
405
|
+
var chalk = createChalk();
|
|
406
|
+
createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
407
|
+
//#endregion
|
|
408
|
+
export { chalk as t };
|
|
409
|
+
|
|
410
|
+
//# sourceMappingURL=source-Br7L7GOI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-Br7L7GOI.js","names":["styles"],"sources":["../../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/ansi-styles/index.js","../../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/supports-color/index.js","../../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/utilities.js","../../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/index.js"],"sourcesContent":["const ANSI_BACKGROUND_OFFSET = 10;\n\nconst wrapAnsi16 = (offset = 0) => code => `\\u001B[${code + offset}m`;\n\nconst wrapAnsi256 = (offset = 0) => code => `\\u001B[${38 + offset};5;${code}m`;\n\nconst wrapAnsi16m = (offset = 0) => (red, green, blue) => `\\u001B[${38 + offset};2;${red};${green};${blue}m`;\n\nconst styles = {\n\tmodifier: {\n\t\treset: [0, 0],\n\t\t// 21 isn't widely supported and 22 does the same thing\n\t\tbold: [1, 22],\n\t\tdim: [2, 22],\n\t\titalic: [3, 23],\n\t\tunderline: [4, 24],\n\t\toverline: [53, 55],\n\t\tinverse: [7, 27],\n\t\thidden: [8, 28],\n\t\tstrikethrough: [9, 29],\n\t},\n\tcolor: {\n\t\tblack: [30, 39],\n\t\tred: [31, 39],\n\t\tgreen: [32, 39],\n\t\tyellow: [33, 39],\n\t\tblue: [34, 39],\n\t\tmagenta: [35, 39],\n\t\tcyan: [36, 39],\n\t\twhite: [37, 39],\n\n\t\t// Bright color\n\t\tblackBright: [90, 39],\n\t\tgray: [90, 39], // Alias of `blackBright`\n\t\tgrey: [90, 39], // Alias of `blackBright`\n\t\tredBright: [91, 39],\n\t\tgreenBright: [92, 39],\n\t\tyellowBright: [93, 39],\n\t\tblueBright: [94, 39],\n\t\tmagentaBright: [95, 39],\n\t\tcyanBright: [96, 39],\n\t\twhiteBright: [97, 39],\n\t},\n\tbgColor: {\n\t\tbgBlack: [40, 49],\n\t\tbgRed: [41, 49],\n\t\tbgGreen: [42, 49],\n\t\tbgYellow: [43, 49],\n\t\tbgBlue: [44, 49],\n\t\tbgMagenta: [45, 49],\n\t\tbgCyan: [46, 49],\n\t\tbgWhite: [47, 49],\n\n\t\t// Bright color\n\t\tbgBlackBright: [100, 49],\n\t\tbgGray: [100, 49], // Alias of `bgBlackBright`\n\t\tbgGrey: [100, 49], // Alias of `bgBlackBright`\n\t\tbgRedBright: [101, 49],\n\t\tbgGreenBright: [102, 49],\n\t\tbgYellowBright: [103, 49],\n\t\tbgBlueBright: [104, 49],\n\t\tbgMagentaBright: [105, 49],\n\t\tbgCyanBright: [106, 49],\n\t\tbgWhiteBright: [107, 49],\n\t},\n};\n\nexport const modifierNames = Object.keys(styles.modifier);\nexport const foregroundColorNames = Object.keys(styles.color);\nexport const backgroundColorNames = Object.keys(styles.bgColor);\nexport const colorNames = [...foregroundColorNames, ...backgroundColorNames];\n\nfunction assembleStyles() {\n\tconst codes = new Map();\n\n\tfor (const [groupName, group] of Object.entries(styles)) {\n\t\tfor (const [styleName, style] of Object.entries(group)) {\n\t\t\tstyles[styleName] = {\n\t\t\t\topen: `\\u001B[${style[0]}m`,\n\t\t\t\tclose: `\\u001B[${style[1]}m`,\n\t\t\t};\n\n\t\t\tgroup[styleName] = styles[styleName];\n\n\t\t\tcodes.set(style[0], style[1]);\n\t\t}\n\n\t\tObject.defineProperty(styles, groupName, {\n\t\t\tvalue: group,\n\t\t\tenumerable: false,\n\t\t});\n\t}\n\n\tObject.defineProperty(styles, 'codes', {\n\t\tvalue: codes,\n\t\tenumerable: false,\n\t});\n\n\tstyles.color.close = '\\u001B[39m';\n\tstyles.bgColor.close = '\\u001B[49m';\n\n\tstyles.color.ansi = wrapAnsi16();\n\tstyles.color.ansi256 = wrapAnsi256();\n\tstyles.color.ansi16m = wrapAnsi16m();\n\tstyles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);\n\tstyles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);\n\tstyles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);\n\n\t// From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js\n\tObject.defineProperties(styles, {\n\t\trgbToAnsi256: {\n\t\t\tvalue(red, green, blue) {\n\t\t\t\t// We use the extended greyscale palette here, with the exception of\n\t\t\t\t// black and white. normal palette only has 4 greyscale shades.\n\t\t\t\tif (red === green && green === blue) {\n\t\t\t\t\tif (red < 8) {\n\t\t\t\t\t\treturn 16;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (red > 248) {\n\t\t\t\t\t\treturn 231;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn Math.round(((red - 8) / 247) * 24) + 232;\n\t\t\t\t}\n\n\t\t\t\treturn 16\n\t\t\t\t\t+ (36 * Math.round(red / 255 * 5))\n\t\t\t\t\t+ (6 * Math.round(green / 255 * 5))\n\t\t\t\t\t+ Math.round(blue / 255 * 5);\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToRgb: {\n\t\t\tvalue(hex) {\n\t\t\t\tconst matches = /[a-f\\d]{6}|[a-f\\d]{3}/i.exec(hex.toString(16));\n\t\t\t\tif (!matches) {\n\t\t\t\t\treturn [0, 0, 0];\n\t\t\t\t}\n\n\t\t\t\tlet [colorString] = matches;\n\n\t\t\t\tif (colorString.length === 3) {\n\t\t\t\t\tcolorString = [...colorString].map(character => character + character).join('');\n\t\t\t\t}\n\n\t\t\t\tconst integer = Number.parseInt(colorString, 16);\n\n\t\t\t\treturn [\n\t\t\t\t\t/* eslint-disable no-bitwise */\n\t\t\t\t\t(integer >> 16) & 0xFF,\n\t\t\t\t\t(integer >> 8) & 0xFF,\n\t\t\t\t\tinteger & 0xFF,\n\t\t\t\t\t/* eslint-enable no-bitwise */\n\t\t\t\t];\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToAnsi256: {\n\t\t\tvalue: hex => styles.rgbToAnsi256(...styles.hexToRgb(hex)),\n\t\t\tenumerable: false,\n\t\t},\n\t\tansi256ToAnsi: {\n\t\t\tvalue(code) {\n\t\t\t\tif (code < 8) {\n\t\t\t\t\treturn 30 + code;\n\t\t\t\t}\n\n\t\t\t\tif (code < 16) {\n\t\t\t\t\treturn 90 + (code - 8);\n\t\t\t\t}\n\n\t\t\t\tlet red;\n\t\t\t\tlet green;\n\t\t\t\tlet blue;\n\n\t\t\t\tif (code >= 232) {\n\t\t\t\t\tred = (((code - 232) * 10) + 8) / 255;\n\t\t\t\t\tgreen = red;\n\t\t\t\t\tblue = red;\n\t\t\t\t} else {\n\t\t\t\t\tcode -= 16;\n\n\t\t\t\t\tconst remainder = code % 36;\n\n\t\t\t\t\tred = Math.floor(code / 36) / 5;\n\t\t\t\t\tgreen = Math.floor(remainder / 6) / 5;\n\t\t\t\t\tblue = (remainder % 6) / 5;\n\t\t\t\t}\n\n\t\t\t\tconst value = Math.max(red, green, blue) * 2;\n\n\t\t\t\tif (value === 0) {\n\t\t\t\t\treturn 30;\n\t\t\t\t}\n\n\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\tlet result = 30 + ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red));\n\n\t\t\t\tif (value === 2) {\n\t\t\t\t\tresult += 60;\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\trgbToAnsi: {\n\t\t\tvalue: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToAnsi: {\n\t\t\tvalue: hex => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),\n\t\t\tenumerable: false,\n\t\t},\n\t});\n\n\treturn styles;\n}\n\nconst ansiStyles = assembleStyles();\n\nexport default ansiStyles;\n","import process from 'node:process';\nimport os from 'node:os';\nimport tty from 'node:tty';\n\n// From: https://github.com/sindresorhus/has-flag/blob/main/index.js\n/// function hasFlag(flag, argv = globalThis.Deno?.args ?? process.argv) {\nfunction hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process.argv) {\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst position = argv.indexOf(prefix + flag);\n\tconst terminatorPosition = argv.indexOf('--');\n\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n}\n\nconst {env} = process;\n\nlet flagForceColor;\nif (\n\thasFlag('no-color')\n\t|| hasFlag('no-colors')\n\t|| hasFlag('color=false')\n\t|| hasFlag('color=never')\n) {\n\tflagForceColor = 0;\n} else if (\n\thasFlag('color')\n\t|| hasFlag('colors')\n\t|| hasFlag('color=true')\n\t|| hasFlag('color=always')\n) {\n\tflagForceColor = 1;\n}\n\nfunction envForceColor() {\n\tif ('FORCE_COLOR' in env) {\n\t\tif (env.FORCE_COLOR === 'true') {\n\t\t\treturn 1;\n\t\t}\n\n\t\tif (env.FORCE_COLOR === 'false') {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);\n\t}\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3,\n\t};\n}\n\nfunction _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {\n\tconst noFlagForceColor = envForceColor();\n\tif (noFlagForceColor !== undefined) {\n\t\tflagForceColor = noFlagForceColor;\n\t}\n\n\tconst forceColor = sniffFlags ? flagForceColor : noFlagForceColor;\n\n\tif (forceColor === 0) {\n\t\treturn 0;\n\t}\n\n\tif (sniffFlags) {\n\t\tif (hasFlag('color=16m')\n\t\t\t|| hasFlag('color=full')\n\t\t\t|| hasFlag('color=truecolor')) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (hasFlag('color=256')) {\n\t\t\treturn 2;\n\t\t}\n\t}\n\n\t// Check for Azure DevOps pipelines.\n\t// Has to be above the `!streamIsTTY` check.\n\tif ('TF_BUILD' in env && 'AGENT_NAME' in env) {\n\t\treturn 1;\n\t}\n\n\tif (haveStream && !streamIsTTY && forceColor === undefined) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor || 0;\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\tif (process.platform === 'win32') {\n\t\t// Windows 10 build 10586 is the first Windows release that supports 256 colors.\n\t\t// Windows 10 build 14931 is the first release that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(osRelease[0]) >= 10\n\t\t\t&& Number(osRelease[2]) >= 10_586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14_931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['GITHUB_ACTIONS', 'GITEA_ACTIONS', 'CIRCLECI'].some(key => key in env)) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (['TRAVIS', 'APPVEYOR', 'GITLAB_CI', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'xterm-kitty') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'xterm-ghostty') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'wezterm') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app': {\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\t}\n\n\t\t\tcase 'Apple_Terminal': {\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\treturn min;\n}\n\nexport function createSupportsColor(stream, options = {}) {\n\tconst level = _supportsColor(stream, {\n\t\tstreamIsTTY: stream && stream.isTTY,\n\t\t...options,\n\t});\n\n\treturn translateLevel(level);\n}\n\nconst supportsColor = {\n\tstdout: createSupportsColor({isTTY: tty.isatty(1)}),\n\tstderr: createSupportsColor({isTTY: tty.isatty(2)}),\n};\n\nexport default supportsColor;\n","// TODO: When targeting Node.js 16, use `String.prototype.replaceAll`.\nexport function stringReplaceAll(string, substring, replacer) {\n\tlet index = string.indexOf(substring);\n\tif (index === -1) {\n\t\treturn string;\n\t}\n\n\tconst substringLength = substring.length;\n\tlet endIndex = 0;\n\tlet returnValue = '';\n\tdo {\n\t\treturnValue += string.slice(endIndex, index) + substring + replacer;\n\t\tendIndex = index + substringLength;\n\t\tindex = string.indexOf(substring, endIndex);\n\t} while (index !== -1);\n\n\treturnValue += string.slice(endIndex);\n\treturn returnValue;\n}\n\nexport function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {\n\tlet endIndex = 0;\n\tlet returnValue = '';\n\tdo {\n\t\tconst gotCR = string[index - 1] === '\\r';\n\t\treturnValue += string.slice(endIndex, (gotCR ? index - 1 : index)) + prefix + (gotCR ? '\\r\\n' : '\\n') + postfix;\n\t\tendIndex = index + 1;\n\t\tindex = string.indexOf('\\n', endIndex);\n\t} while (index !== -1);\n\n\treturnValue += string.slice(endIndex);\n\treturn returnValue;\n}\n","import ansiStyles from '#ansi-styles';\nimport supportsColor from '#supports-color';\nimport { // eslint-disable-line import/order\n\tstringReplaceAll,\n\tstringEncaseCRLFWithFirstIndex,\n} from './utilities.js';\n\nconst {stdout: stdoutColor, stderr: stderrColor} = supportsColor;\n\nconst GENERATOR = Symbol('GENERATOR');\nconst STYLER = Symbol('STYLER');\nconst IS_EMPTY = Symbol('IS_EMPTY');\n\n// `supportsColor.level` → `ansiStyles.color[name]` mapping\nconst levelMapping = [\n\t'ansi',\n\t'ansi',\n\t'ansi256',\n\t'ansi16m',\n];\n\nconst styles = Object.create(null);\n\nconst applyOptions = (object, options = {}) => {\n\tif (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {\n\t\tthrow new Error('The `level` option should be an integer from 0 to 3');\n\t}\n\n\t// Detect level if not set manually\n\tconst colorLevel = stdoutColor ? stdoutColor.level : 0;\n\tobject.level = options.level === undefined ? colorLevel : options.level;\n};\n\nexport class Chalk {\n\tconstructor(options) {\n\t\t// eslint-disable-next-line no-constructor-return\n\t\treturn chalkFactory(options);\n\t}\n}\n\nconst chalkFactory = options => {\n\tconst chalk = (...strings) => strings.join(' ');\n\tapplyOptions(chalk, options);\n\n\tObject.setPrototypeOf(chalk, createChalk.prototype);\n\n\treturn chalk;\n};\n\nfunction createChalk(options) {\n\treturn chalkFactory(options);\n}\n\nObject.setPrototypeOf(createChalk.prototype, Function.prototype);\n\nfor (const [styleName, style] of Object.entries(ansiStyles)) {\n\tstyles[styleName] = {\n\t\tget() {\n\t\t\tconst builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);\n\t\t\tObject.defineProperty(this, styleName, {value: builder});\n\t\t\treturn builder;\n\t\t},\n\t};\n}\n\nstyles.visible = {\n\tget() {\n\t\tconst builder = createBuilder(this, this[STYLER], true);\n\t\tObject.defineProperty(this, 'visible', {value: builder});\n\t\treturn builder;\n\t},\n};\n\nconst getModelAnsi = (model, level, type, ...arguments_) => {\n\tif (model === 'rgb') {\n\t\tif (level === 'ansi16m') {\n\t\t\treturn ansiStyles[type].ansi16m(...arguments_);\n\t\t}\n\n\t\tif (level === 'ansi256') {\n\t\t\treturn ansiStyles[type].ansi256(ansiStyles.rgbToAnsi256(...arguments_));\n\t\t}\n\n\t\treturn ansiStyles[type].ansi(ansiStyles.rgbToAnsi(...arguments_));\n\t}\n\n\tif (model === 'hex') {\n\t\treturn getModelAnsi('rgb', level, type, ...ansiStyles.hexToRgb(...arguments_));\n\t}\n\n\treturn ansiStyles[type][model](...arguments_);\n};\n\nconst usedModels = ['rgb', 'hex', 'ansi256'];\n\nfor (const model of usedModels) {\n\tstyles[model] = {\n\t\tget() {\n\t\t\tconst {level} = this;\n\t\t\treturn function (...arguments_) {\n\t\t\t\tconst styler = createStyler(getModelAnsi(model, levelMapping[level], 'color', ...arguments_), ansiStyles.color.close, this[STYLER]);\n\t\t\t\treturn createBuilder(this, styler, this[IS_EMPTY]);\n\t\t\t};\n\t\t},\n\t};\n\n\tconst bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);\n\tstyles[bgModel] = {\n\t\tget() {\n\t\t\tconst {level} = this;\n\t\t\treturn function (...arguments_) {\n\t\t\t\tconst styler = createStyler(getModelAnsi(model, levelMapping[level], 'bgColor', ...arguments_), ansiStyles.bgColor.close, this[STYLER]);\n\t\t\t\treturn createBuilder(this, styler, this[IS_EMPTY]);\n\t\t\t};\n\t\t},\n\t};\n}\n\nconst proto = Object.defineProperties(() => {}, {\n\t...styles,\n\tlevel: {\n\t\tenumerable: true,\n\t\tget() {\n\t\t\treturn this[GENERATOR].level;\n\t\t},\n\t\tset(level) {\n\t\t\tthis[GENERATOR].level = level;\n\t\t},\n\t},\n});\n\nconst createStyler = (open, close, parent) => {\n\tlet openAll;\n\tlet closeAll;\n\tif (parent === undefined) {\n\t\topenAll = open;\n\t\tcloseAll = close;\n\t} else {\n\t\topenAll = parent.openAll + open;\n\t\tcloseAll = close + parent.closeAll;\n\t}\n\n\treturn {\n\t\topen,\n\t\tclose,\n\t\topenAll,\n\t\tcloseAll,\n\t\tparent,\n\t};\n};\n\nconst createBuilder = (self, _styler, _isEmpty) => {\n\t// Single argument is hot path, implicit coercion is faster than anything\n\t// eslint-disable-next-line no-implicit-coercion\n\tconst builder = (...arguments_) => applyStyle(builder, (arguments_.length === 1) ? ('' + arguments_[0]) : arguments_.join(' '));\n\n\t// We alter the prototype because we must return a function, but there is\n\t// no way to create a function with a different prototype\n\tObject.setPrototypeOf(builder, proto);\n\n\tbuilder[GENERATOR] = self;\n\tbuilder[STYLER] = _styler;\n\tbuilder[IS_EMPTY] = _isEmpty;\n\n\treturn builder;\n};\n\nconst applyStyle = (self, string) => {\n\tif (self.level <= 0 || !string) {\n\t\treturn self[IS_EMPTY] ? '' : string;\n\t}\n\n\tlet styler = self[STYLER];\n\n\tif (styler === undefined) {\n\t\treturn string;\n\t}\n\n\tconst {openAll, closeAll} = styler;\n\tif (string.includes('\\u001B')) {\n\t\twhile (styler !== undefined) {\n\t\t\t// Replace any instances already present with a re-opening code\n\t\t\t// otherwise only the part of the string until said closing code\n\t\t\t// will be colored, and the rest will simply be 'plain'.\n\t\t\tstring = stringReplaceAll(string, styler.close, styler.open);\n\n\t\t\tstyler = styler.parent;\n\t\t}\n\t}\n\n\t// We can move both next actions out of loop, because remaining actions in loop won't have\n\t// any/visible effect on parts we add here. Close the styling before a linebreak and reopen\n\t// after next line to fix a bleed issue on macOS: https://github.com/chalk/chalk/pull/92\n\tconst lfIndex = string.indexOf('\\n');\n\tif (lfIndex !== -1) {\n\t\tstring = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);\n\t}\n\n\treturn openAll + string + closeAll;\n};\n\nObject.defineProperties(createChalk.prototype, styles);\n\nconst chalk = createChalk();\nexport const chalkStderr = createChalk({level: stderrColor ? stderrColor.level : 0});\n\nexport {\n\tmodifierNames,\n\tforegroundColorNames,\n\tbackgroundColorNames,\n\tcolorNames,\n\n\t// TODO: Remove these aliases in the next major version\n\tmodifierNames as modifiers,\n\tforegroundColorNames as foregroundColors,\n\tbackgroundColorNames as backgroundColors,\n\tcolorNames as colors,\n} from './vendor/ansi-styles/index.js';\n\nexport {\n\tstdoutColor as supportsColor,\n\tstderrColor as supportsColorStderr,\n};\n\nexport default chalk;\n"],"x_google_ignoreList":[0,1,2,3],"mappings":";;;;;;AAAA,IAAM,yBAAyB;AAE/B,IAAM,cAAc,SAAS,OAAM,SAAQ,UAAU,OAAO,OAAO;AAEnE,IAAM,eAAe,SAAS,OAAM,SAAQ,UAAU,KAAK,OAAO,KAAK,KAAK;AAE5E,IAAM,eAAe,SAAS,OAAO,KAAK,OAAO,SAAS,UAAU,KAAK,OAAO,KAAK,IAAI,GAAG,MAAM,GAAG,KAAK;AAE1G,IAAMA,WAAS;CACd,UAAU;EACT,OAAO,CAAC,GAAG,CAAC;EAEZ,MAAM,CAAC,GAAG,EAAE;EACZ,KAAK,CAAC,GAAG,EAAE;EACX,QAAQ,CAAC,GAAG,EAAE;EACd,WAAW,CAAC,GAAG,EAAE;EACjB,UAAU,CAAC,IAAI,EAAE;EACjB,SAAS,CAAC,GAAG,EAAE;EACf,QAAQ,CAAC,GAAG,EAAE;EACd,eAAe,CAAC,GAAG,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,OAAO;CAC3B;CAEA,OAAO;EACN;EACA;EACA;EACA;EACA;CACD;AACD;AAEA,IAAM,iBAAiB,MAAM,SAAS,aAAa;CAGlD,MAAM,WAAW,GAAG,eAAe,WAAW,SAAU,WAAW,WAAW,IAAM,KAAK,WAAW,KAAM,WAAW,KAAK,GAAG,CAAC;CAI9H,OAAO,eAAe,SAAS,KAAK;CAEpC,QAAQ,aAAa;CACrB,QAAQ,UAAU;CAClB,QAAQ,YAAY;CAEpB,OAAO;AACR;AAEA,IAAM,cAAc,MAAM,WAAW;CACpC,IAAI,KAAK,SAAS,KAAK,CAAC,QACvB,OAAO,KAAK,YAAY,KAAK;CAG9B,IAAI,SAAS,KAAK;CAElB,IAAI,WAAW,KAAA,GACd,OAAO;CAGR,MAAM,EAAC,SAAS,aAAY;CAC5B,IAAI,OAAO,SAAS,MAAQ,GAC3B,OAAO,WAAW,KAAA,GAAW;EAI5B,SAAS,iBAAiB,QAAQ,OAAO,OAAO,OAAO,IAAI;EAE3D,SAAS,OAAO;CACjB;CAMD,MAAM,UAAU,OAAO,QAAQ,IAAI;CACnC,IAAI,YAAY,IACf,SAAS,+BAA+B,QAAQ,UAAU,SAAS,OAAO;CAG3E,OAAO,UAAU,SAAS;AAC3B;AAEA,OAAO,iBAAiB,YAAY,WAAW,MAAM;AAErD,IAAM,QAAQ,YAAY;AACC,YAAY,EAAC,OAAO,cAAc,YAAY,QAAQ,EAAC,CAAC"}
|
|
@@ -107,7 +107,9 @@ export declare function isRowLevelSecurityDenial(error: unknown): boolean;
|
|
|
107
107
|
* @param context - A human-readable context string (e.g. collection slug or path)
|
|
108
108
|
* @returns An object with a `message` safe for the client and the PG `code`.
|
|
109
109
|
*/
|
|
110
|
-
export declare function pgErrorToFriendlyMessage(pgError: PostgresError, context: string
|
|
110
|
+
export declare function pgErrorToFriendlyMessage(pgError: PostgresError, context: string, options?: {
|
|
111
|
+
verbose?: boolean;
|
|
112
|
+
}): {
|
|
111
113
|
message: string;
|
|
112
114
|
code: string;
|
|
113
115
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Serve NUMERIC columns as JavaScript numbers.
|
|
3
|
+
*
|
|
4
|
+
* A property declared `type: "number"` without `validation.integer` becomes a
|
|
5
|
+
* Postgres `numeric` column (see `generate-drizzle-schema-logic`). Postgres
|
|
6
|
+
* sends `numeric` as text, node-postgres registers no parser for OID 1700, and
|
|
7
|
+
* drizzle's `PgNumeric.mapFromDriverValue` keeps the string — so a price
|
|
8
|
+
* written as `2.5` reads back as `"2.5"`. The generated SDK types that field
|
|
9
|
+
* `number`, the OpenAPI document this server publishes says `type: number`, and
|
|
10
|
+
* the admin's view model parses it as a number, so the string is the one shape
|
|
11
|
+
* nothing in the system claims. It also breaks *asymmetrically*: the create
|
|
12
|
+
* response carries the number and the read that follows carries the string, so
|
|
13
|
+
* a client that multiplies a price works until the first refresh.
|
|
14
|
+
*
|
|
15
|
+
* Cast here — in the driver's row mapping — rather than in one of the read
|
|
16
|
+
* paths, because there are several of them (the relational query builder, the
|
|
17
|
+
* `select` fallback, the realtime frame, the admin's view model) and only the
|
|
18
|
+
* REST renderer used to coerce. Every one of them goes through the column's
|
|
19
|
+
* `mapFromDriverValue`, so this is the single place that cannot be bypassed.
|
|
20
|
+
*
|
|
21
|
+
* The cast is safe for what a `number` property can hold: declaring a property
|
|
22
|
+
* `number` already promises double precision — that is what the admin has
|
|
23
|
+
* always parsed it to and what the generated `Row` type says. A column wider
|
|
24
|
+
* than a double (a hand-written `numeric(38, 0)` reached through an
|
|
25
|
+
* introspected collection) loses precision, which is the trade the declared
|
|
26
|
+
* type already made.
|
|
27
|
+
*
|
|
28
|
+
* `null` stays `null`; an unparseable value stays whatever the driver sent,
|
|
29
|
+
* because inventing `NaN` for it would be worse than passing it through.
|
|
30
|
+
*/
|
|
31
|
+
export declare function patchPgNumericToNumber(tables: Record<string, unknown>): void;
|