@augment-vir/node 31.40.0 → 31.42.0

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 (40) hide show
  1. package/dist/augments/docker.d.ts +2 -1
  2. package/dist/augments/docker.js +2 -1
  3. package/dist/augments/terminal/shell.js +7 -2
  4. package/dist/docker/containers/run-container.mock.js +1 -0
  5. package/dist/index.d.ts +0 -1
  6. package/dist/index.js +0 -1
  7. package/dist/scripts/fix-ts-bin.script.js +6 -0
  8. package/package.json +9 -9
  9. package/src/augments/docker.ts +2 -1
  10. package/src/augments/terminal/shell.ts +7 -2
  11. package/src/docker/containers/run-container.mock.ts +2 -0
  12. package/src/index.ts +0 -1
  13. package/src/scripts/fix-ts-bin.script.ts +6 -0
  14. package/dist/augments/prisma.d.ts +0 -157
  15. package/dist/augments/prisma.js +0 -156
  16. package/dist/prisma/disable-ci-env.mock.d.ts +0 -2
  17. package/dist/prisma/disable-ci-env.mock.js +0 -81
  18. package/dist/prisma/model-data.d.ts +0 -88
  19. package/dist/prisma/model-data.js +0 -84
  20. package/dist/prisma/prisma-client.d.ts +0 -5
  21. package/dist/prisma/prisma-client.js +0 -25
  22. package/dist/prisma/prisma-database.d.ts +0 -11
  23. package/dist/prisma/prisma-database.js +0 -30
  24. package/dist/prisma/prisma-database.mock.d.ts +0 -1
  25. package/dist/prisma/prisma-database.mock.js +0 -25
  26. package/dist/prisma/prisma-errors.d.ts +0 -37
  27. package/dist/prisma/prisma-errors.js +0 -43
  28. package/dist/prisma/prisma-migrations.d.ts +0 -24
  29. package/dist/prisma/prisma-migrations.js +0 -98
  30. package/dist/prisma/run-prisma-command.d.ts +0 -29
  31. package/dist/prisma/run-prisma-command.js +0 -67
  32. package/src/augments/prisma.ts +0 -177
  33. package/src/prisma/disable-ci-env.mock.ts +0 -88
  34. package/src/prisma/model-data.ts +0 -252
  35. package/src/prisma/prisma-client.ts +0 -45
  36. package/src/prisma/prisma-database.mock.ts +0 -31
  37. package/src/prisma/prisma-database.ts +0 -60
  38. package/src/prisma/prisma-errors.ts +0 -45
  39. package/src/prisma/prisma-migrations.ts +0 -153
  40. package/src/prisma/run-prisma-command.ts +0 -94
@@ -15,8 +15,9 @@ export { type DockerEnvMap, type DockerPortMap, type DockerVolumeMap, type Docke
15
15
  export { type RunDockerContainerCommandParams } from '../docker/containers/run-command.js';
16
16
  export { type RunDockerContainerParams } from '../docker/containers/run-container.js';
17
17
  /**
18
- * Centralized Docker API from `@augment-vir/node`.
18
+ * Centralized Docker API.
19
19
  *
20
+ * @deprecated Use the [docker-vir](https://www.npmjs.com/package/docker-vir) package instead.
20
21
  * @category Node : Docker
21
22
  * @category Package : @augment-vir/node
22
23
  * @package [`@augment-vir/node`](https://www.npmjs.com/package/@augment-vir/node)
@@ -10,8 +10,9 @@ import { isImageInLocalRegistry, removeImageFromLocalRegistry, updateImage, } fr
10
10
  import { isDockerRunning, startDocker } from '../docker/docker-startup.js';
11
11
  export { DockerContainerStatus, exitedDockerContainerStatuses, } from '../docker/containers/container-status.js';
12
12
  /**
13
- * Centralized Docker API from `@augment-vir/node`.
13
+ * Centralized Docker API.
14
14
  *
15
+ * @deprecated Use the [docker-vir](https://www.npmjs.com/package/docker-vir) package instead.
15
16
  * @category Node : Docker
16
17
  * @category Package : @augment-vir/node
17
18
  * @package [`@augment-vir/node`](https://www.npmjs.com/package/@augment-vir/node)
@@ -99,8 +99,13 @@ export function streamShellCommand(command, cwd, shell = 'bash', env = process.e
99
99
  const exitSignal = inputExitSignal ?? undefined;
100
100
  if ((exitCode !== undefined && exitCode !== 0) || exitSignal !== undefined) {
101
101
  const execException = new Error(`Command failed: ${command}`);
102
- execException.code = exitCode;
103
- execException.signal = exitSignal;
102
+ if (exitCode != undefined) {
103
+ execException.code = exitCode;
104
+ }
105
+ /* node:coverage ignore next 3: idk how to get this to trigger */
106
+ if (exitSignal != undefined) {
107
+ execException.signal = exitSignal;
108
+ }
104
109
  execException.cmd = command;
105
110
  execException.killed = childProcess.killed;
106
111
  execException.cwd = cwd;
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @typescript-eslint/no-deprecated */
1
2
  import { docker } from '../../augments/docker.js';
2
3
  export async function runMockLongLivingContainer(containerName, args = {}) {
3
4
  await docker.container.run({
package/dist/index.d.ts CHANGED
@@ -16,7 +16,6 @@ export * from './augments/path/os-path.js';
16
16
  export * from './augments/path/resolve-import.js';
17
17
  export * from './augments/path/root.js';
18
18
  export * from './augments/path/sanitize-path.js';
19
- export * from './augments/prisma.js';
20
19
  export * from './augments/terminal/question.js';
21
20
  export * from './augments/terminal/relevant-args.js';
22
21
  export * from './augments/terminal/run-cli-script.js';
package/dist/index.js CHANGED
@@ -16,7 +16,6 @@ export * from './augments/path/os-path.js';
16
16
  export * from './augments/path/resolve-import.js';
17
17
  export * from './augments/path/root.js';
18
18
  export * from './augments/path/sanitize-path.js';
19
- export * from './augments/prisma.js';
20
19
  export * from './augments/terminal/question.js';
21
20
  export * from './augments/terminal/relevant-args.js';
22
21
  export * from './augments/terminal/run-cli-script.js';
@@ -43,6 +43,12 @@ const packagesToFix = [
43
43
  scriptPath: join('prettier', 'bin', 'prettier.cjs'),
44
44
  fixImport: false,
45
45
  },
46
+ {
47
+ packageName: '@web/test-runner',
48
+ binName: 'web-test-runner',
49
+ scriptPath: join('@web/test-runner', 'dist', 'bin.js'),
50
+ fixImport: false,
51
+ },
46
52
  ];
47
53
  function createBinFileContents({ scriptPath }) {
48
54
  return [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@augment-vir/node",
3
- "version": "31.40.0",
3
+ "version": "31.42.0",
4
4
  "description": "A collection of augments, helpers types, functions, and classes only for Node.js (backend) JavaScript environments.",
5
5
  "keywords": [
6
6
  "augment",
@@ -38,20 +38,20 @@
38
38
  "test:update": "npm test"
39
39
  },
40
40
  "dependencies": {
41
- "@augment-vir/assert": "^31.40.0",
42
- "@augment-vir/common": "^31.40.0",
43
- "@date-vir/duration": "^7.4.2",
41
+ "@augment-vir/assert": "^31.42.0",
42
+ "@augment-vir/common": "^31.42.0",
43
+ "@date-vir/duration": "^8.0.0",
44
44
  "ansi-styles": "^6.2.3",
45
45
  "sanitize-filename": "^1.6.3",
46
46
  "terminate": "^2.8.0",
47
47
  "tsx": "^4.20.6",
48
- "type-fest": "^5.0.1",
48
+ "type-fest": "^5.1.0",
49
49
  "typed-event-target": "^4.1.0"
50
50
  },
51
51
  "devDependencies": {
52
- "@augment-vir/test": "^31.40.0",
53
- "@prisma/client": "^6.16.3",
54
- "@types/node": "^24.6.2",
52
+ "@augment-vir/test": "^31.42.0",
53
+ "@prisma/client": "^6.17.1",
54
+ "@types/node": "^24.9.1",
55
55
  "@web/dev-server-esbuild": "^1.0.4",
56
56
  "@web/test-runner": "^0.20.2",
57
57
  "@web/test-runner-commands": "^0.9.0",
@@ -59,7 +59,7 @@
59
59
  "@web/test-runner-visual-regression": "^0.10.0",
60
60
  "c8": "^10.1.3",
61
61
  "istanbul-smart-text-reporter": "^1.1.5",
62
- "prisma": "^6.16.3",
62
+ "prisma": "^6.17.1",
63
63
  "typescript": "^5.9.3"
64
64
  },
65
65
  "peerDependencies": {
@@ -42,8 +42,9 @@ export {type RunDockerContainerCommandParams} from '../docker/containers/run-com
42
42
  export {type RunDockerContainerParams} from '../docker/containers/run-container.js';
43
43
 
44
44
  /**
45
- * Centralized Docker API from `@augment-vir/node`.
45
+ * Centralized Docker API.
46
46
  *
47
+ * @deprecated Use the [docker-vir](https://www.npmjs.com/package/docker-vir) package instead.
47
48
  * @category Node : Docker
48
49
  * @category Package : @augment-vir/node
49
50
  * @package [`@augment-vir/node`](https://www.npmjs.com/package/@augment-vir/node)
@@ -133,8 +133,13 @@ export function streamShellCommand(
133
133
  const execException: ExecException & {cwd?: string | undefined} = new Error(
134
134
  `Command failed: ${command}`,
135
135
  );
136
- execException.code = exitCode;
137
- execException.signal = exitSignal;
136
+ if (exitCode != undefined) {
137
+ execException.code = exitCode;
138
+ }
139
+ /* node:coverage ignore next 3: idk how to get this to trigger */
140
+ if (exitSignal != undefined) {
141
+ execException.signal = exitSignal;
142
+ }
138
143
  execException.cmd = command;
139
144
  execException.killed = childProcess.killed;
140
145
  execException.cwd = cwd;
@@ -1,3 +1,5 @@
1
+ /* eslint-disable @typescript-eslint/no-deprecated */
2
+
1
3
  import {docker} from '../../augments/docker.js';
2
4
  import {type RunDockerContainerParams} from './run-container.js';
3
5
 
package/src/index.ts CHANGED
@@ -16,7 +16,6 @@ export * from './augments/path/os-path.js';
16
16
  export * from './augments/path/resolve-import.js';
17
17
  export * from './augments/path/root.js';
18
18
  export * from './augments/path/sanitize-path.js';
19
- export * from './augments/prisma.js';
20
19
  export * from './augments/terminal/question.js';
21
20
  export * from './augments/terminal/relevant-args.js';
22
21
  export * from './augments/terminal/run-cli-script.js';
@@ -53,6 +53,12 @@ const packagesToFix: ReadonlyArray<Readonly<PackageToFix>> = [
53
53
  scriptPath: join('prettier', 'bin', 'prettier.cjs'),
54
54
  fixImport: false,
55
55
  },
56
+ {
57
+ packageName: '@web/test-runner',
58
+ binName: 'web-test-runner',
59
+ scriptPath: join('@web/test-runner', 'dist', 'bin.js'),
60
+ fixImport: false,
61
+ },
56
62
  ];
57
63
 
58
64
  function createBinFileContents({scriptPath}: Readonly<Pick<PackageToFix, 'scriptPath'>>): string {
@@ -1,157 +0,0 @@
1
- import { addData, dumpData } from '../prisma/model-data.js';
2
- import { generatePrismaClient, isGeneratedPrismaClientCurrent } from '../prisma/prisma-client.js';
3
- import { doesPrismaDiffExist, getPrismaDiff, resetDevPrismaDatabase } from '../prisma/prisma-database.js';
4
- import { applyPrismaMigrationsToDev, applyPrismaMigrationsToProd, createPrismaMigration, getMigrationStatus } from '../prisma/prisma-migrations.js';
5
- export type { PrismaAddDataData as PrismaAddModelData, PrismaDataDumpOptions, PrismaDumpOutput, } from '../prisma/model-data.js';
6
- export * from '../prisma/prisma-errors.js';
7
- export type { PrismaMigrationStatus } from '../prisma/prisma-migrations.js';
8
- export { prismaCommandsThatSupportNoHints, runPrismaCommand } from '../prisma/run-prisma-command.js';
9
- /**
10
- * Centralized Prisma API from `@augment-vir/node`.
11
- *
12
- * ## Prisma flows
13
- *
14
- * - Deploy to production
15
- *
16
- * - `prisma.migration.applyProd()`
17
- * - Update dev environment
18
- *
19
- * - Apply migrations: `prisma.migration.applyDev`
20
- *
21
- * - If throws {@link PrismaMigrationNeededError}, prompt user for a new migration name and pass it to
22
- * `prisma.migration.create`
23
- * - If throws {@link PrismaResetNeededError}, reset the database with `prisma.database.resetDev`
24
- * - Generate client: `prisma.client.isCurrent`
25
- *
26
- * - If `false`, run `prisma.client.generate`
27
- *
28
- * @deprecated Use the `prisma-vir` package instead.
29
- * @category Prisma : Node
30
- * @category Package : @augment-vir/node
31
- * @package [`@augment-vir/node`](https://www.npmjs.com/package/@augment-vir/node)
32
- */
33
- export declare const prisma: {
34
- migration: {
35
- /**
36
- * Get current migration status.
37
- *
38
- * @see https://www.prisma.io/docs/orm/reference/prisma-cli-reference#migrate-status
39
- */
40
- status: typeof getMigrationStatus;
41
- /**
42
- * Creates a new migration.
43
- *
44
- * @see https://www.prisma.io/docs/orm/reference/prisma-cli-reference#migrate-dev
45
- */
46
- create: typeof createPrismaMigration;
47
- /**
48
- * Apply all migrations. Meant for a production environment.
49
- *
50
- * @see https://www.prisma.io/docs/orm/reference/prisma-cli-reference#migrate-deploy
51
- */
52
- applyProd: typeof applyPrismaMigrationsToProd;
53
- /**
54
- * Apply all migrations. Meant for a development environment, with less protections than
55
- * `prisma.migration.applyProd()`
56
- *
57
- * @throws `PrismaMigrationNeededError` when a new migration is required so the user needs
58
- * to input a name.
59
- * @throws `PrismaResetNeededError` when there's a migration mismatch with the database and
60
- * it needs to be reset.
61
- * @see https://www.prisma.io/docs/orm/reference/prisma-cli-reference#migrate-dev
62
- */
63
- applyDev: typeof applyPrismaMigrationsToDev;
64
- };
65
- database: {
66
- /**
67
- * Force resets a dev database to match the current Prisma schema and migrations.
68
- *
69
- * **This will destroy all data. Do not use in production.**
70
- *
71
- * @see https://www.prisma.io/docs/orm/reference/prisma-cli-reference#migrate-reset
72
- */
73
- resetDev: typeof resetDevPrismaDatabase;
74
- /**
75
- * Uses `prisma.database.diff` to detect if there are any differences between the current
76
- * database and the Prisma schema that should control it.
77
- */
78
- hasDiff: typeof doesPrismaDiffExist;
79
- /**
80
- * Gets a string list of all differences between the current database and the Prisma schema
81
- * that should control it.
82
- *
83
- * @see https://www.prisma.io/docs/orm/reference/prisma-cli-reference#migrate-diff
84
- */
85
- diff: typeof getPrismaDiff;
86
- };
87
- client: {
88
- /**
89
- * Runs Prisma generators included in the given Prisma schema (which usually includes the
90
- * Prisma JS client). This will work even if the database doesn't exist yet.
91
- *
92
- * @example
93
- *
94
- * ```ts
95
- * import {prisma} from '@augment-vir/node';
96
- *
97
- * prisma.client.generate('../../prisma/schema.prisma');
98
- * ```
99
- */
100
- generate: typeof generatePrismaClient;
101
- /**
102
- * Detects if the current generated Prisma JS Client was generated from the current Prisma
103
- * schema.
104
- */
105
- isCurrent: typeof isGeneratedPrismaClientCurrent;
106
- /**
107
- * Adds a collection of create data entries to a database through a `PrismaClient` instance.
108
- * This is particularly useful for setting up mocks in a mock PrismaClient.
109
- *
110
- * @example
111
- *
112
- * ```ts
113
- * import {addPrismaModelData} from '@augment-vir/common';
114
- * import {PrismaClient} from '@prisma/client';
115
- *
116
- * await addPrismaModelData(new PrismaClient(), [
117
- * {
118
- * user: {
119
- * mockUser1: {
120
- * first_name: 'one',
121
- * id: 123,
122
- * // etc.
123
- * },
124
- * mockUser2: {
125
- * first_name: 'two',
126
- * id: 124,
127
- * authRole: 'user',
128
- * // etc.
129
- * },
130
- * },
131
- * },
132
- * {
133
- * region: [
134
- * {
135
- * id: 1,
136
- * name: 'North America',
137
- * // etc.
138
- * },
139
- * {
140
- * id: 2,
141
- * name: 'Europe',
142
- * // etc.
143
- * },
144
- * ],
145
- * },
146
- * ]);
147
- * ```
148
- */
149
- addData: typeof addData;
150
- /**
151
- * Dump data from the current database through a `PrismaClient` instance.
152
- *
153
- * @see {@link PrismaDataDumpOptions}
154
- */
155
- dumpData: typeof dumpData;
156
- };
157
- };
@@ -1,156 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-deprecated */
2
- import { addData, dumpData } from '../prisma/model-data.js';
3
- import { generatePrismaClient, isGeneratedPrismaClientCurrent } from '../prisma/prisma-client.js';
4
- import { doesPrismaDiffExist, getPrismaDiff, resetDevPrismaDatabase, } from '../prisma/prisma-database.js';
5
- import { applyPrismaMigrationsToDev, applyPrismaMigrationsToProd, createPrismaMigration, getMigrationStatus, } from '../prisma/prisma-migrations.js';
6
- export * from '../prisma/prisma-errors.js';
7
- export { prismaCommandsThatSupportNoHints, runPrismaCommand } from '../prisma/run-prisma-command.js';
8
- /**
9
- * Centralized Prisma API from `@augment-vir/node`.
10
- *
11
- * ## Prisma flows
12
- *
13
- * - Deploy to production
14
- *
15
- * - `prisma.migration.applyProd()`
16
- * - Update dev environment
17
- *
18
- * - Apply migrations: `prisma.migration.applyDev`
19
- *
20
- * - If throws {@link PrismaMigrationNeededError}, prompt user for a new migration name and pass it to
21
- * `prisma.migration.create`
22
- * - If throws {@link PrismaResetNeededError}, reset the database with `prisma.database.resetDev`
23
- * - Generate client: `prisma.client.isCurrent`
24
- *
25
- * - If `false`, run `prisma.client.generate`
26
- *
27
- * @deprecated Use the `prisma-vir` package instead.
28
- * @category Prisma : Node
29
- * @category Package : @augment-vir/node
30
- * @package [`@augment-vir/node`](https://www.npmjs.com/package/@augment-vir/node)
31
- */
32
- export const prisma = {
33
- migration: {
34
- /**
35
- * Get current migration status.
36
- *
37
- * @see https://www.prisma.io/docs/orm/reference/prisma-cli-reference#migrate-status
38
- */
39
- status: getMigrationStatus,
40
- /**
41
- * Creates a new migration.
42
- *
43
- * @see https://www.prisma.io/docs/orm/reference/prisma-cli-reference#migrate-dev
44
- */
45
- create: createPrismaMigration,
46
- /**
47
- * Apply all migrations. Meant for a production environment.
48
- *
49
- * @see https://www.prisma.io/docs/orm/reference/prisma-cli-reference#migrate-deploy
50
- */
51
- applyProd: applyPrismaMigrationsToProd,
52
- /**
53
- * Apply all migrations. Meant for a development environment, with less protections than
54
- * `prisma.migration.applyProd()`
55
- *
56
- * @throws `PrismaMigrationNeededError` when a new migration is required so the user needs
57
- * to input a name.
58
- * @throws `PrismaResetNeededError` when there's a migration mismatch with the database and
59
- * it needs to be reset.
60
- * @see https://www.prisma.io/docs/orm/reference/prisma-cli-reference#migrate-dev
61
- */
62
- applyDev: applyPrismaMigrationsToDev,
63
- },
64
- database: {
65
- /**
66
- * Force resets a dev database to match the current Prisma schema and migrations.
67
- *
68
- * **This will destroy all data. Do not use in production.**
69
- *
70
- * @see https://www.prisma.io/docs/orm/reference/prisma-cli-reference#migrate-reset
71
- */
72
- resetDev: resetDevPrismaDatabase,
73
- /**
74
- * Uses `prisma.database.diff` to detect if there are any differences between the current
75
- * database and the Prisma schema that should control it.
76
- */
77
- hasDiff: doesPrismaDiffExist,
78
- /**
79
- * Gets a string list of all differences between the current database and the Prisma schema
80
- * that should control it.
81
- *
82
- * @see https://www.prisma.io/docs/orm/reference/prisma-cli-reference#migrate-diff
83
- */
84
- diff: getPrismaDiff,
85
- },
86
- client: {
87
- /**
88
- * Runs Prisma generators included in the given Prisma schema (which usually includes the
89
- * Prisma JS client). This will work even if the database doesn't exist yet.
90
- *
91
- * @example
92
- *
93
- * ```ts
94
- * import {prisma} from '@augment-vir/node';
95
- *
96
- * prisma.client.generate('../../prisma/schema.prisma');
97
- * ```
98
- */
99
- generate: generatePrismaClient,
100
- /**
101
- * Detects if the current generated Prisma JS Client was generated from the current Prisma
102
- * schema.
103
- */
104
- isCurrent: isGeneratedPrismaClientCurrent,
105
- /**
106
- * Adds a collection of create data entries to a database through a `PrismaClient` instance.
107
- * This is particularly useful for setting up mocks in a mock PrismaClient.
108
- *
109
- * @example
110
- *
111
- * ```ts
112
- * import {addPrismaModelData} from '@augment-vir/common';
113
- * import {PrismaClient} from '@prisma/client';
114
- *
115
- * await addPrismaModelData(new PrismaClient(), [
116
- * {
117
- * user: {
118
- * mockUser1: {
119
- * first_name: 'one',
120
- * id: 123,
121
- * // etc.
122
- * },
123
- * mockUser2: {
124
- * first_name: 'two',
125
- * id: 124,
126
- * authRole: 'user',
127
- * // etc.
128
- * },
129
- * },
130
- * },
131
- * {
132
- * region: [
133
- * {
134
- * id: 1,
135
- * name: 'North America',
136
- * // etc.
137
- * },
138
- * {
139
- * id: 2,
140
- * name: 'Europe',
141
- * // etc.
142
- * },
143
- * ],
144
- * },
145
- * ]);
146
- * ```
147
- */
148
- addData,
149
- /**
150
- * Dump data from the current database through a `PrismaClient` instance.
151
- *
152
- * @see {@link PrismaDataDumpOptions}
153
- */
154
- dumpData,
155
- },
156
- };
@@ -1,2 +0,0 @@
1
- import { type MaybePromise } from '@augment-vir/common';
2
- export declare function testWithNonCiEnv(callback: () => MaybePromise<void>): () => Promise<void>;
@@ -1,81 +0,0 @@
1
- // cspell:disable
2
- import { arrayToObject } from '@augment-vir/common';
3
- /**
4
- * These are all the env flags that Prisma reads for determining if it's being executed within a CI
5
- * environment. This list was retrieved from
6
- * https://github.com/prisma/prisma/blob/075d31287c90b757fd9bd8d9b36032e6349fa671/packages/internals/src/utils/isCi.ts.
7
- */
8
- const prismaCiFlags = [
9
- 'CI',
10
- 'CONTINUOUS_INTEGRATION',
11
- 'BUILD_NUMBER',
12
- 'RUN_ID',
13
- 'AGOLA_GIT_REF',
14
- 'AC_APPCIRCLE',
15
- 'APPVEYOR',
16
- 'CODEBUILD',
17
- 'TF_BUILD',
18
- 'bamboo_planKey',
19
- 'BITBUCKET_COMMIT',
20
- 'BITRISE_IO',
21
- 'BUDDY_WORKSPACE_ID',
22
- 'BUILDKITE',
23
- 'CIRCLECI',
24
- 'CIRRUS_CI',
25
- 'CF_BUILD_ID',
26
- 'CM_BUILD_ID',
27
- 'CI_NAME',
28
- 'DRONE',
29
- 'DSARI',
30
- 'EARTHLY_CI',
31
- 'EAS_BUILD',
32
- 'GERRIT_PROJECT',
33
- 'GITEA_ACTIONS',
34
- 'GITHUB_ACTIONS',
35
- 'GITLAB_CI',
36
- 'GOCD',
37
- 'BUILDER_OUTPUT',
38
- 'HARNESS_BUILD_ID',
39
- 'JENKINS_URL',
40
- 'BUILD_ID',
41
- 'LAYERCI',
42
- 'MAGNUM',
43
- 'NETLIFY',
44
- 'NEVERCODE',
45
- 'PROW_JOB_ID',
46
- 'RELEASE_BUILD_ID',
47
- 'RENDER',
48
- 'SAILCI',
49
- 'HUDSON',
50
- 'JENKINS_URL',
51
- 'BUILD_ID',
52
- 'SCREWDRIVER',
53
- 'SEMAPHORE',
54
- 'SOURCEHUT',
55
- 'STRIDER',
56
- 'TASK_ID',
57
- 'RUN_ID',
58
- 'TEAMCITY_VERSION',
59
- 'TRAVIS',
60
- 'VELA',
61
- 'NOW_BUILDER',
62
- 'APPCENTER_BUILD_ID',
63
- 'CI_XCODE_PROJECT',
64
- 'XCS',
65
- ];
66
- export function testWithNonCiEnv(callback) {
67
- return async () => {
68
- const usedKeys = prismaCiFlags.filter((ciFlag) => ciFlag in process.env);
69
- /** For already non-CI environments. */
70
- /* node:coverage ignore next 6 */
71
- const originalEnvValues = arrayToObject(usedKeys, (key) => {
72
- return {
73
- key,
74
- value: process.env[key],
75
- };
76
- });
77
- usedKeys.forEach((key) => delete process.env[key]);
78
- await callback();
79
- usedKeys.forEach((key) => (process.env[key] = originalEnvValues[key]));
80
- };
81
- }
@@ -1,88 +0,0 @@
1
- import { type BasePrismaClient, type BaseTypeMap, type FirstLetterLowercase, type PartialWithUndefined, type PrismaAllModelsCreate, type PrismaBasicModel, type PrismaModelName } from '@augment-vir/common';
2
- import { type IsAny } from 'type-fest';
3
- /**
4
- * Params for `prisma.client.addData()`. This is similar to {@link PrismaAllModelsCreate} but allows
5
- * an array of {@link PrismaAllModelsCreate} for sequential data creation.
6
- *
7
- * @deprecated Use the `prisma-vir` package instead.
8
- * @category Prisma : Node
9
- * @category Package : @augment-vir/node
10
- * @example
11
- *
12
- * ```ts
13
- * import {PrismaAddModelData} from '@augment-vir/common';
14
- * import {type PrismaClient} from '@prisma/client';
15
- *
16
- * const mockData: PrismaAddModelData<PrismaClient> = [
17
- * {
18
- * user: {
19
- * mockUser1: {
20
- * first_name: 'one',
21
- * id: 123,
22
- * // etc.
23
- * },
24
- * mockUser2: {
25
- * first_name: 'two',
26
- * id: 124,
27
- * authRole: 'user',
28
- * // etc.
29
- * },
30
- * },
31
- * },
32
- * {
33
- * region: [
34
- * {
35
- * id: 1,
36
- * name: 'North America',
37
- * // etc.
38
- * },
39
- * {
40
- * id: 2,
41
- * name: 'Europe',
42
- * // etc.
43
- * },
44
- * ],
45
- * },
46
- * ];
47
- * ```
48
- *
49
- * @package [`@augment-vir/node`](https://www.npmjs.com/package/@augment-vir/node)
50
- */
51
- export type PrismaAddDataData<PrismaClient extends BasePrismaClient, TypeMap extends BaseTypeMap> = Readonly<PrismaAllModelsCreate<PrismaClient, TypeMap>> | ReadonlyArray<Readonly<PrismaAllModelsCreate<PrismaClient, TypeMap>>>;
52
- export declare function addData<const PrismaClient extends BasePrismaClient, const TypeMap extends BaseTypeMap>(prismaClient: Readonly<PrismaClient>, data: IsAny<PrismaClient> extends true ? any : PrismaAddDataData<PrismaClient, TypeMap>): Promise<void>;
53
- /** These are not the real model names, they are the names on the PrismaClient (which are lowercase). */
54
- export declare function getAllPrismaModelKeys(prismaClient: BasePrismaClient): string[];
55
- /**
56
- * Options for `prisma.client.dumpData`.
57
- *
58
- * @deprecated Use the `prisma-vir` package instead.
59
- * @category Prisma : Node
60
- * @category Package : @augment-vir/node
61
- * @package [`@augment-vir/node`](https://www.npmjs.com/package/@augment-vir/node)
62
- */
63
- export type PrismaDataDumpOptions = {
64
- /**
65
- * The max number of entries to load per model. Set to `0` to remove this limit altogether
66
- * (which could be _very_ expensive for your database).
67
- *
68
- * @default 100
69
- */
70
- limit: number;
71
- /**
72
- * Strings to omit from the dumped data. For testability, omitting date or UUID id fields is a
73
- * common practice.
74
- */
75
- omitFields: string[];
76
- };
77
- /**
78
- * Output for `prisma.client.dumpData`.
79
- *
80
- * @deprecated Use the `prisma-vir` package instead.
81
- * @category Prisma : Node
82
- * @category Package : @augment-vir/node
83
- * @package [`@augment-vir/node`](https://www.npmjs.com/package/@augment-vir/node)
84
- */
85
- export type PrismaDumpOutput<TypeMap extends BaseTypeMap> = Partial<{
86
- [Model in PrismaModelName<TypeMap> as FirstLetterLowercase<Model>]: PrismaBasicModel<TypeMap, Model>[];
87
- }>;
88
- export declare function dumpData<const TypeMap extends BaseTypeMap>(prismaClient: BasePrismaClient, options?: Readonly<PartialWithUndefined<PrismaDataDumpOptions>>): Promise<PrismaDumpOutput<TypeMap>>;