@accounter/server 0.0.9-alpha-20251210092501-282f1edb15104a44035c03de5c123d71533ca4a5 → 0.0.9-alpha-20251210092707-6eb504331bad23e8fe87f4bf5f4645123f2bee06
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/CHANGELOG.md +20 -5
- package/dist/green-invoice-graphql/src/mesh-artifacts/index.d.ts +1 -1
- package/dist/server/src/__tests__/helpers/migration-verification.d.ts +1 -1
- package/dist/server/src/__tests__/helpers/migration-verification.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/helpers/migration-verification.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @accounter/server
|
|
2
2
|
|
|
3
|
-
## 0.0.9-alpha-
|
|
3
|
+
## 0.0.9-alpha-20251210092707-6eb504331bad23e8fe87f4bf5f4645123f2bee06
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
@@ -159,6 +159,21 @@
|
|
|
159
159
|
updated with comprehensive documentation on the new test suite structure, how to run tests, and
|
|
160
160
|
prerequisites for integration tests.
|
|
161
161
|
|
|
162
|
+
- [#2796](https://github.com/Urigo/accounter-fullstack/pull/2796)
|
|
163
|
+
[`6eb5043`](https://github.com/Urigo/accounter-fullstack/commit/6eb504331bad23e8fe87f4bf5f4645123f2bee06)
|
|
164
|
+
Thanks [@gilgardosh](https://github.com/gilgardosh)! - - **Centralized Migration Verification
|
|
165
|
+
Logic**: Introduced a new helper module `migration-verification.ts` that centralizes the logic for
|
|
166
|
+
checking and asserting whether the latest database migration has been applied. This module
|
|
167
|
+
provides both a non-throwing `checkLatestMigration` function and an `assertLatestMigrationApplied`
|
|
168
|
+
function that throws an error if the migration is not found.
|
|
169
|
+
- **New CI/CD Migration Verification Script**: Added a new standalone script
|
|
170
|
+
`verify-migrations.ts` that leverages the centralized verification logic. This script connects
|
|
171
|
+
to a PostgreSQL database using environment variables and exits with a non-zero status if the
|
|
172
|
+
latest migration is not applied, making it suitable for CI/CD pipelines.
|
|
173
|
+
- **Refactored Test Suite**: Updated the `db-bootstrap.test.ts` file to utilize the newly created
|
|
174
|
+
`assertLatestMigrationApplied` utility, replacing the previous inline query for migration
|
|
175
|
+
verification. This improves consistency and reduces code duplication in tests.
|
|
176
|
+
|
|
162
177
|
- [#2751](https://github.com/Urigo/accounter-fullstack/pull/2751)
|
|
163
178
|
[`77ad870`](https://github.com/Urigo/accounter-fullstack/commit/77ad8705cfadfab6a4e182c80937b8d96467098a)
|
|
164
179
|
Thanks [@gilgardosh](https://github.com/gilgardosh)! - - **Centralized DB Pool Management**: The
|
|
@@ -234,10 +249,10 @@
|
|
|
234
249
|
[`ef68321`](https://github.com/Urigo/accounter-fullstack/commit/ef68321608d60a7208e82a2c413f27beb502e3cc),
|
|
235
250
|
[`ef68321`](https://github.com/Urigo/accounter-fullstack/commit/ef68321608d60a7208e82a2c413f27beb502e3cc),
|
|
236
251
|
[`c7d6f21`](https://github.com/Urigo/accounter-fullstack/commit/c7d6f21ed62658159b1323334501daca03c8d3e5)]:
|
|
237
|
-
- @accounter/green-invoice-graphql@0.8.3-alpha-
|
|
238
|
-
- @accounter/pcn874-generator@0.6.4-alpha-
|
|
239
|
-
- @accounter/shaam-uniform-format-generator@0.2.3-alpha-
|
|
240
|
-
- @accounter/shaam6111-generator@0.1.5-alpha-
|
|
252
|
+
- @accounter/green-invoice-graphql@0.8.3-alpha-20251210092707-6eb504331bad23e8fe87f4bf5f4645123f2bee06
|
|
253
|
+
- @accounter/pcn874-generator@0.6.4-alpha-20251210092707-6eb504331bad23e8fe87f4bf5f4645123f2bee06
|
|
254
|
+
- @accounter/shaam-uniform-format-generator@0.2.3-alpha-20251210092707-6eb504331bad23e8fe87f4bf5f4645123f2bee06
|
|
255
|
+
- @accounter/shaam6111-generator@0.1.5-alpha-20251210092707-6eb504331bad23e8fe87f4bf5f4645123f2bee06
|
|
241
256
|
|
|
242
257
|
## 0.0.8
|
|
243
258
|
|
|
@@ -4,8 +4,8 @@ import type { GetMeshOptions } from '@graphql-mesh/runtime';
|
|
|
4
4
|
import type { YamlConfig } from '@graphql-mesh/types';
|
|
5
5
|
import { MeshHTTPHandler } from '@graphql-mesh/http';
|
|
6
6
|
import { type ExecuteMeshFn, type SubscribeMeshFn, type MeshContext as BaseMeshContext, type MeshInstance } from '@graphql-mesh/runtime';
|
|
7
|
-
import type { GreenInvoiceTypes } from './sources/GreenInvoice/types';
|
|
8
7
|
import type { GreenInvoiceNewTypes } from './sources/GreenInvoiceNew/types';
|
|
8
|
+
import type { GreenInvoiceTypes } from './sources/GreenInvoice/types';
|
|
9
9
|
export type Maybe<T> = T | null;
|
|
10
10
|
export type InputMaybe<T> = Maybe<T>;
|
|
11
11
|
export type Exact<T extends {
|
|
@@ -15,4 +15,4 @@ export declare function checkLatestMigration(clientOrPool: Pool | PoolClient | C
|
|
|
15
15
|
* Assert that the latest migration has been applied.
|
|
16
16
|
* Throws an error with helpful message if not.
|
|
17
17
|
*/
|
|
18
|
-
export declare function assertLatestMigrationApplied(clientOrPool: Pool | PoolClient, schema?: string): Promise<void>;
|
|
18
|
+
export declare function assertLatestMigrationApplied(clientOrPool: Pool | PoolClient | Client, schema?: string): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration-verification.js","sourceRoot":"","sources":["../../../../../src/__tests__/helpers/migration-verification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,IAAI,EAAc,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iDAAiD,CAAC;AAExF,OAAO,EAAE,qBAAqB,EAAE,CAAC;AAQjC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,YAAwC,EACxC,MAAM,GAAG,kBAAkB;IAE3B,IAAI,MAA2B,CAAC;IAChC,IAAI,aAAa,GAAG,KAAK,CAAC;IAE1B,IAAI,YAAY,YAAY,IAAI,EAAE,CAAC;QACjC,MAAM,UAAU,GAAG,MAAM,YAAY,CAAC,OAAO,EAAE,CAAC;QAChD,MAAM,GAAG,UAAU,CAAC;QACpB,aAAa,GAAG,IAAI,CAAC;IACvB,CAAC;SAAM,CAAC;QACN,sCAAsC;QACtC,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"migration-verification.js","sourceRoot":"","sources":["../../../../../src/__tests__/helpers/migration-verification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,IAAI,EAAc,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iDAAiD,CAAC;AAExF,OAAO,EAAE,qBAAqB,EAAE,CAAC;AAQjC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,YAAwC,EACxC,MAAM,GAAG,kBAAkB;IAE3B,IAAI,MAA2B,CAAC;IAChC,IAAI,aAAa,GAAG,KAAK,CAAC;IAE1B,IAAI,YAAY,YAAY,IAAI,EAAE,CAAC;QACjC,MAAM,UAAU,GAAG,MAAM,YAAY,CAAC,OAAO,EAAE,CAAC;QAChD,MAAM,GAAG,UAAU,CAAC;QACpB,aAAa,GAAG,IAAI,CAAC;IACvB,CAAC;SAAM,CAAC;QACN,sCAAsC;QACtC,MAAM,GAAG,YAAY,CAAC;IACxB,CAAC;IAED,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,CAC/B,iBAAiB,MAAM,oCAAoC,EAC3D,CAAC,qBAAqB,CAAC,CACxB,CAAC;QAEF,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,KAAK,CAAC,CAAC;QACvC,OAAO;YACL,QAAQ;YACR,mBAAmB,EAAE,qBAAqB;YAC1C,YAAY,EAAE,QAAQ;gBACpB,CAAC,CAAC,SAAS;gBACX,CAAC,CAAC,qBAAqB,qBAAqB,yBAAyB;SACxE,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,QAAQ,EAAE,KAAK;YACf,mBAAmB,EAAE,qBAAqB;YAC1C,YAAY,EAAE,+BAA+B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;SACtG,CAAC;IACJ,CAAC;YAAS,CAAC;QACT,IAAI,aAAa,IAAI,SAAS,IAAI,MAAM,EAAE,CAAC;YACzC,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;QACzB,CAAC;IACH,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAChD,YAAwC,EACxC,MAAM,GAAG,kBAAkB;IAE3B,MAAM,MAAM,GAAG,MAAM,oBAAoB,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IAChE,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CACb,MAAM,CAAC,YAAY;YACjB,8BAA8B,MAAM,CAAC,mBAAmB,2DAA2D,CACtH,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -26,7 +26,7 @@ export async function checkLatestMigration(
|
|
|
26
26
|
shouldRelease = true;
|
|
27
27
|
} else {
|
|
28
28
|
// It's already a Client or PoolClient
|
|
29
|
-
client = clientOrPool
|
|
29
|
+
client = clientOrPool;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
try {
|
|
@@ -61,7 +61,7 @@ export async function checkLatestMigration(
|
|
|
61
61
|
* Throws an error with helpful message if not.
|
|
62
62
|
*/
|
|
63
63
|
export async function assertLatestMigrationApplied(
|
|
64
|
-
clientOrPool: Pool | PoolClient,
|
|
64
|
+
clientOrPool: Pool | PoolClient | Client,
|
|
65
65
|
schema = 'accounter_schema',
|
|
66
66
|
): Promise<void> {
|
|
67
67
|
const result = await checkLatestMigration(clientOrPool, schema);
|