@open-mercato/core 0.6.3-develop.3797.1.9d6338d7cd → 0.6.3-develop.3805.1.357827108c

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.
@@ -1,4 +1,4 @@
1
- [build:core] found 2599 entry points
1
+ [build:core] found 2600 entry points
2
2
  [build:core] built successfully
3
3
  [build:core:generated] found 172 entry points
4
4
  [build:core:generated] built successfully
@@ -0,0 +1,55 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+ import { NextResponse } from "next/server";
4
+ import { z } from "zod";
5
+ const versionResponseSchema = z.object({
6
+ version: z.string()
7
+ });
8
+ function readDeployedVersion() {
9
+ const explicit = process.env.OM_VERSION || process.env.OPEN_MERCATO_VERSION;
10
+ if (explicit && explicit.length > 0) return explicit;
11
+ try {
12
+ const packageJsonPath = path.join(process.cwd(), "package.json");
13
+ const parsed = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
14
+ if (typeof parsed.version === "string" && parsed.version.length > 0) return parsed.version;
15
+ } catch {
16
+ }
17
+ return "0.0.0-dev";
18
+ }
19
+ const deployedVersion = readDeployedVersion();
20
+ const metadata = {
21
+ path: "/version",
22
+ GET: {
23
+ requireAuth: false,
24
+ rateLimit: { points: 30, duration: 60, keyPrefix: "api_version" }
25
+ }
26
+ };
27
+ async function GET() {
28
+ const body = { version: deployedVersion };
29
+ return NextResponse.json(body);
30
+ }
31
+ var version_default = GET;
32
+ const openApi = {
33
+ tag: "API Documentation",
34
+ summary: "Deployed Open Mercato version",
35
+ methods: {
36
+ GET: {
37
+ summary: "Return the deployed Open Mercato version",
38
+ tags: ["API Documentation"],
39
+ responses: [
40
+ {
41
+ status: 200,
42
+ description: "Current deployment version metadata",
43
+ schema: versionResponseSchema
44
+ }
45
+ ]
46
+ }
47
+ }
48
+ };
49
+ export {
50
+ GET,
51
+ version_default as default,
52
+ metadata,
53
+ openApi
54
+ };
55
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/modules/api_docs/api/get/version.ts"],
4
+ "sourcesContent": ["import fs from 'node:fs'\nimport path from 'node:path'\nimport { NextResponse } from 'next/server'\nimport { z } from 'zod'\nimport type { OpenApiRouteDoc } from '@open-mercato/shared/lib/openapi'\n\nconst versionResponseSchema = z.object({\n version: z.string(),\n})\n\ntype VersionResponse = z.infer<typeof versionResponseSchema>\n\nfunction readDeployedVersion(): string {\n // Explicit override wins: deployments that bundle a different version than the\n // running app's package.json (or want to pin the Open Mercato platform version)\n // set OM_VERSION / OPEN_MERCATO_VERSION.\n const explicit = process.env.OM_VERSION || process.env.OPEN_MERCATO_VERSION\n if (explicit && explicit.length > 0) return explicit\n try {\n const packageJsonPath = path.join(process.cwd(), 'package.json')\n const parsed = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8')) as { version?: string }\n if (typeof parsed.version === 'string' && parsed.version.length > 0) return parsed.version\n } catch {\n // Fall through to the development sentinel below.\n }\n return '0.0.0-dev'\n}\n\nconst deployedVersion = readDeployedVersion()\n\nexport const metadata = {\n path: '/version',\n GET: {\n requireAuth: false,\n rateLimit: { points: 30, duration: 60, keyPrefix: 'api_version' },\n },\n}\n\nexport async function GET() {\n const body: VersionResponse = { version: deployedVersion }\n return NextResponse.json(body)\n}\n\nexport default GET\n\nexport const openApi: OpenApiRouteDoc = {\n tag: 'API Documentation',\n summary: 'Deployed Open Mercato version',\n methods: {\n GET: {\n summary: 'Return the deployed Open Mercato version',\n tags: ['API Documentation'],\n responses: [\n {\n status: 200,\n description: 'Current deployment version metadata',\n schema: versionResponseSchema,\n },\n ],\n },\n },\n}\n"],
5
+ "mappings": "AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,SAAS,oBAAoB;AAC7B,SAAS,SAAS;AAGlB,MAAM,wBAAwB,EAAE,OAAO;AAAA,EACrC,SAAS,EAAE,OAAO;AACpB,CAAC;AAID,SAAS,sBAA8B;AAIrC,QAAM,WAAW,QAAQ,IAAI,cAAc,QAAQ,IAAI;AACvD,MAAI,YAAY,SAAS,SAAS,EAAG,QAAO;AAC5C,MAAI;AACF,UAAM,kBAAkB,KAAK,KAAK,QAAQ,IAAI,GAAG,cAAc;AAC/D,UAAM,SAAS,KAAK,MAAM,GAAG,aAAa,iBAAiB,MAAM,CAAC;AAClE,QAAI,OAAO,OAAO,YAAY,YAAY,OAAO,QAAQ,SAAS,EAAG,QAAO,OAAO;AAAA,EACrF,QAAQ;AAAA,EAER;AACA,SAAO;AACT;AAEA,MAAM,kBAAkB,oBAAoB;AAErC,MAAM,WAAW;AAAA,EACtB,MAAM;AAAA,EACN,KAAK;AAAA,IACH,aAAa;AAAA,IACb,WAAW,EAAE,QAAQ,IAAI,UAAU,IAAI,WAAW,cAAc;AAAA,EAClE;AACF;AAEA,eAAsB,MAAM;AAC1B,QAAM,OAAwB,EAAE,SAAS,gBAAgB;AACzD,SAAO,aAAa,KAAK,IAAI;AAC/B;AAEA,IAAO,kBAAQ;AAER,MAAM,UAA2B;AAAA,EACtC,KAAK;AAAA,EACL,SAAS;AAAA,EACT,SAAS;AAAA,IACP,KAAK;AAAA,MACH,SAAS;AAAA,MACT,MAAM,CAAC,mBAAmB;AAAA,MAC1B,WAAW;AAAA,QACT;AAAA,UACE,QAAQ;AAAA,UACR,aAAa;AAAA,UACb,QAAQ;AAAA,QACV;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;",
6
+ "names": []
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-mercato/core",
3
- "version": "0.6.3-develop.3797.1.9d6338d7cd",
3
+ "version": "0.6.3-develop.3805.1.357827108c",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {
@@ -243,16 +243,16 @@
243
243
  "zod": "^4.4.3"
244
244
  },
245
245
  "peerDependencies": {
246
- "@open-mercato/ai-assistant": "0.6.3-develop.3797.1.9d6338d7cd",
247
- "@open-mercato/shared": "0.6.3-develop.3797.1.9d6338d7cd",
248
- "@open-mercato/ui": "0.6.3-develop.3797.1.9d6338d7cd",
246
+ "@open-mercato/ai-assistant": "0.6.3-develop.3805.1.357827108c",
247
+ "@open-mercato/shared": "0.6.3-develop.3805.1.357827108c",
248
+ "@open-mercato/ui": "0.6.3-develop.3805.1.357827108c",
249
249
  "react": "^19.0.0",
250
250
  "react-dom": "^19.0.0"
251
251
  },
252
252
  "devDependencies": {
253
- "@open-mercato/ai-assistant": "0.6.3-develop.3797.1.9d6338d7cd",
254
- "@open-mercato/shared": "0.6.3-develop.3797.1.9d6338d7cd",
255
- "@open-mercato/ui": "0.6.3-develop.3797.1.9d6338d7cd",
253
+ "@open-mercato/ai-assistant": "0.6.3-develop.3805.1.357827108c",
254
+ "@open-mercato/shared": "0.6.3-develop.3805.1.357827108c",
255
+ "@open-mercato/ui": "0.6.3-develop.3805.1.357827108c",
256
256
  "@testing-library/dom": "^10.4.1",
257
257
  "@testing-library/jest-dom": "^6.9.1",
258
258
  "@testing-library/react": "^16.3.1",
@@ -0,0 +1,62 @@
1
+ import fs from 'node:fs'
2
+ import path from 'node:path'
3
+ import { NextResponse } from 'next/server'
4
+ import { z } from 'zod'
5
+ import type { OpenApiRouteDoc } from '@open-mercato/shared/lib/openapi'
6
+
7
+ const versionResponseSchema = z.object({
8
+ version: z.string(),
9
+ })
10
+
11
+ type VersionResponse = z.infer<typeof versionResponseSchema>
12
+
13
+ function readDeployedVersion(): string {
14
+ // Explicit override wins: deployments that bundle a different version than the
15
+ // running app's package.json (or want to pin the Open Mercato platform version)
16
+ // set OM_VERSION / OPEN_MERCATO_VERSION.
17
+ const explicit = process.env.OM_VERSION || process.env.OPEN_MERCATO_VERSION
18
+ if (explicit && explicit.length > 0) return explicit
19
+ try {
20
+ const packageJsonPath = path.join(process.cwd(), 'package.json')
21
+ const parsed = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8')) as { version?: string }
22
+ if (typeof parsed.version === 'string' && parsed.version.length > 0) return parsed.version
23
+ } catch {
24
+ // Fall through to the development sentinel below.
25
+ }
26
+ return '0.0.0-dev'
27
+ }
28
+
29
+ const deployedVersion = readDeployedVersion()
30
+
31
+ export const metadata = {
32
+ path: '/version',
33
+ GET: {
34
+ requireAuth: false,
35
+ rateLimit: { points: 30, duration: 60, keyPrefix: 'api_version' },
36
+ },
37
+ }
38
+
39
+ export async function GET() {
40
+ const body: VersionResponse = { version: deployedVersion }
41
+ return NextResponse.json(body)
42
+ }
43
+
44
+ export default GET
45
+
46
+ export const openApi: OpenApiRouteDoc = {
47
+ tag: 'API Documentation',
48
+ summary: 'Deployed Open Mercato version',
49
+ methods: {
50
+ GET: {
51
+ summary: 'Return the deployed Open Mercato version',
52
+ tags: ['API Documentation'],
53
+ responses: [
54
+ {
55
+ status: 200,
56
+ description: 'Current deployment version metadata',
57
+ schema: versionResponseSchema,
58
+ },
59
+ ],
60
+ },
61
+ },
62
+ }