create-mercato-app 0.6.6-develop.6388.1.b9b9f5e778 → 0.6.6-develop.6390.1.210bbbc703

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.
@@ -2,7 +2,7 @@
2
2
  "auth": {
3
3
  "title": "Authentication & Accounts",
4
4
  "description": "User accounts, sessions, roles and password resets.",
5
- "coreVersion": "0.6.6-develop.6388.1.b9b9f5e778",
5
+ "coreVersion": "0.6.6-develop.6390.1.210bbbc703",
6
6
  "entities": [
7
7
  {
8
8
  "id": "auth:user",
@@ -191,7 +191,7 @@
191
191
  "catalog": {
192
192
  "title": "Product Catalog",
193
193
  "description": "Configurable catalog for products, variants, and pricing used by the sales module.",
194
- "coreVersion": "0.6.6-develop.6388.1.b9b9f5e778",
194
+ "coreVersion": "0.6.6-develop.6390.1.210bbbc703",
195
195
  "entities": [
196
196
  {
197
197
  "id": "catalog:catalog_option_schema_template",
@@ -405,7 +405,7 @@
405
405
  "currencies": {
406
406
  "title": "Currencies",
407
407
  "description": "Currencies and Exchange rate management",
408
- "coreVersion": "0.6.6-develop.6388.1.b9b9f5e778",
408
+ "coreVersion": "0.6.6-develop.6390.1.210bbbc703",
409
409
  "entities": [
410
410
  {
411
411
  "id": "currencies:currency",
@@ -489,7 +489,7 @@
489
489
  "customer_accounts": {
490
490
  "title": "Customer Identity & Portal Authentication",
491
491
  "description": "Customer-facing authentication with two-tier identity model and full RBAC.",
492
- "coreVersion": "0.6.6-develop.6388.1.b9b9f5e778",
492
+ "coreVersion": "0.6.6-develop.6390.1.210bbbc703",
493
493
  "entities": [
494
494
  {
495
495
  "id": "customer_accounts:customer_user",
@@ -729,7 +729,7 @@
729
729
  "customers": {
730
730
  "title": "Customer Relationship Management",
731
731
  "description": "Core CRM capabilities for people, companies, deals, and activities.",
732
- "coreVersion": "0.6.6-develop.6388.1.b9b9f5e778",
732
+ "coreVersion": "0.6.6-develop.6390.1.210bbbc703",
733
733
  "entities": [
734
734
  {
735
735
  "id": "customers:customer_entity",
@@ -1211,7 +1211,7 @@
1211
1211
  "data_sync": {
1212
1212
  "title": "Data Sync",
1213
1213
  "description": "Streaming data sync hub for import/export integrations.",
1214
- "coreVersion": "0.6.6-develop.6388.1.b9b9f5e778",
1214
+ "coreVersion": "0.6.6-develop.6390.1.210bbbc703",
1215
1215
  "entities": [
1216
1216
  {
1217
1217
  "id": "data_sync:sync_run",
@@ -1289,7 +1289,7 @@
1289
1289
  "integrations": {
1290
1290
  "title": "Integrations",
1291
1291
  "description": "Core integration framework — external ID mapping, status badges, and integration registry.",
1292
- "coreVersion": "0.6.6-develop.6388.1.b9b9f5e778",
1292
+ "coreVersion": "0.6.6-develop.6390.1.210bbbc703",
1293
1293
  "entities": [
1294
1294
  {
1295
1295
  "id": "integrations:sync_external_id_mapping",
@@ -1365,7 +1365,7 @@
1365
1365
  "sales": {
1366
1366
  "title": "Sales Management",
1367
1367
  "description": "Quoting, ordering, fulfillment, and billing capabilities built on modular pricing and tax pipelines.",
1368
- "coreVersion": "0.6.6-develop.6388.1.b9b9f5e778",
1368
+ "coreVersion": "0.6.6-develop.6390.1.210bbbc703",
1369
1369
  "entities": [
1370
1370
  {
1371
1371
  "id": "sales:sales_channel",
@@ -1838,7 +1838,7 @@
1838
1838
  "workflows": {
1839
1839
  "title": "Workflow Engine",
1840
1840
  "description": "Orchestrate business processes with state machines, transitions, and activities",
1841
- "coreVersion": "0.6.6-develop.6388.1.b9b9f5e778",
1841
+ "coreVersion": "0.6.6-develop.6390.1.210bbbc703",
1842
1842
  "entities": [
1843
1843
  {
1844
1844
  "id": "workflows:workflow_definition",
@@ -1,5 +1,5 @@
1
1
  # auth — module facts (generated, do not edit)
2
- <!-- generated from @open-mercato/core 0.6.6-develop.6388.1.b9b9f5e778 — R1 staleness stamp -->
2
+ <!-- generated from @open-mercato/core 0.6.6-develop.6390.1.210bbbc703 — R1 staleness stamp -->
3
3
 
4
4
  ## Entities
5
5
 
@@ -1,5 +1,5 @@
1
1
  # catalog — module facts (generated, do not edit)
2
- <!-- generated from @open-mercato/core 0.6.6-develop.6388.1.b9b9f5e778 — R1 staleness stamp -->
2
+ <!-- generated from @open-mercato/core 0.6.6-develop.6390.1.210bbbc703 — R1 staleness stamp -->
3
3
 
4
4
  ## Entities
5
5
 
@@ -1,5 +1,5 @@
1
1
  # currencies — module facts (generated, do not edit)
2
- <!-- generated from @open-mercato/core 0.6.6-develop.6388.1.b9b9f5e778 — R1 staleness stamp -->
2
+ <!-- generated from @open-mercato/core 0.6.6-develop.6390.1.210bbbc703 — R1 staleness stamp -->
3
3
 
4
4
  ## Entities
5
5
 
@@ -1,5 +1,5 @@
1
1
  # customer_accounts — module facts (generated, do not edit)
2
- <!-- generated from @open-mercato/core 0.6.6-develop.6388.1.b9b9f5e778 — R1 staleness stamp -->
2
+ <!-- generated from @open-mercato/core 0.6.6-develop.6390.1.210bbbc703 — R1 staleness stamp -->
3
3
 
4
4
  ## Entities
5
5
 
@@ -1,5 +1,5 @@
1
1
  # customers — module facts (generated, do not edit)
2
- <!-- generated from @open-mercato/core 0.6.6-develop.6388.1.b9b9f5e778 — R1 staleness stamp -->
2
+ <!-- generated from @open-mercato/core 0.6.6-develop.6390.1.210bbbc703 — R1 staleness stamp -->
3
3
 
4
4
  ## Entities
5
5
 
@@ -1,5 +1,5 @@
1
1
  # data_sync — module facts (generated, do not edit)
2
- <!-- generated from @open-mercato/core 0.6.6-develop.6388.1.b9b9f5e778 — R1 staleness stamp -->
2
+ <!-- generated from @open-mercato/core 0.6.6-develop.6390.1.210bbbc703 — R1 staleness stamp -->
3
3
 
4
4
  ## Entities
5
5
 
@@ -1,5 +1,5 @@
1
1
  # integrations — module facts (generated, do not edit)
2
- <!-- generated from @open-mercato/core 0.6.6-develop.6388.1.b9b9f5e778 — R1 staleness stamp -->
2
+ <!-- generated from @open-mercato/core 0.6.6-develop.6390.1.210bbbc703 — R1 staleness stamp -->
3
3
 
4
4
  ## Entities
5
5
 
@@ -1,5 +1,5 @@
1
1
  # sales — module facts (generated, do not edit)
2
- <!-- generated from @open-mercato/core 0.6.6-develop.6388.1.b9b9f5e778 — R1 staleness stamp -->
2
+ <!-- generated from @open-mercato/core 0.6.6-develop.6390.1.210bbbc703 — R1 staleness stamp -->
3
3
 
4
4
  ## Entities
5
5
 
@@ -1,5 +1,5 @@
1
1
  # workflows — module facts (generated, do not edit)
2
- <!-- generated from @open-mercato/core 0.6.6-develop.6388.1.b9b9f5e778 — R1 staleness stamp -->
2
+ <!-- generated from @open-mercato/core 0.6.6-develop.6390.1.210bbbc703 — R1 staleness stamp -->
3
3
 
4
4
  ## Entities
5
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-mercato-app",
3
- "version": "0.6.6-develop.6388.1.b9b9f5e778",
3
+ "version": "0.6.6-develop.6390.1.210bbbc703",
4
4
  "type": "module",
5
5
  "description": "Create a new Open Mercato application",
6
6
  "main": "./dist/index.js",
@@ -22,8 +22,8 @@
22
22
  "ts-morph": "^28.0.0"
23
23
  },
24
24
  "devDependencies": {
25
- "@open-mercato/cli": "0.6.6-develop.6388.1.b9b9f5e778",
26
- "@open-mercato/shared": "0.6.6-develop.6388.1.b9b9f5e778",
25
+ "@open-mercato/cli": "0.6.6-develop.6390.1.210bbbc703",
26
+ "@open-mercato/shared": "0.6.6-develop.6390.1.210bbbc703",
27
27
  "@types/node": "^26.0.0",
28
28
  "esbuild": "^0.28.1",
29
29
  "tsx": "^4.22.4",
@@ -565,6 +565,12 @@ function applyLocalDevBackgroundServiceDefaults(childEnv) {
565
565
  ) {
566
566
  env.OM_AUTO_SPAWN_WORKERS_LAZY = 'true'
567
567
  }
568
+ if (
569
+ typeof process.env.OM_AUTO_SPAWN_WORKERS_LAZY_MODE !== 'string'
570
+ || process.env.OM_AUTO_SPAWN_WORKERS_LAZY_MODE.trim() === ''
571
+ ) {
572
+ env.OM_AUTO_SPAWN_WORKERS_LAZY_MODE = 'shared'
573
+ }
568
574
  if (
569
575
  typeof process.env.OM_AUTO_SPAWN_SCHEDULER_LAZY !== 'string'
570
576
  || process.env.OM_AUTO_SPAWN_SCHEDULER_LAZY.trim() === ''
@@ -16,6 +16,7 @@ import { getCachedRateLimiterService } from '@open-mercato/core/bootstrap'
16
16
  import { checkRateLimit, getClientIp, RATE_LIMIT_ERROR_KEY, RATE_LIMIT_ERROR_FALLBACK } from '@open-mercato/shared/lib/ratelimit/helpers'
17
17
  import { getGlobalEventBus } from '@open-mercato/shared/modules/events'
18
18
  import { applicationLifecycleEvents, type ApplicationLifecycleEventId } from '@open-mercato/shared/lib/runtime/events'
19
+ import { withModuleResourceUsage } from '@open-mercato/shared/lib/modules/resource-usage'
19
20
 
20
21
  // Ensure all package registrations are initialized for API routes.
21
22
  bootstrap()
@@ -39,6 +40,10 @@ type MethodMetadata = {
39
40
  requireRoles?: string[]
40
41
  requireFeatures?: string[]
41
42
  rateLimit?: RateLimitConfig
43
+ /** Route-declared opt-out from module-resource-usage tracking (e.g. an endpoint that itself
44
+ * reads/clears that telemetry, so tracking it would perturb the data it just reported). Set
45
+ * `skipModuleResourceUsageTracking: true` in the route's `metadata` export for the method. */
46
+ skipModuleResourceUsageTracking?: boolean
42
47
  }
43
48
 
44
49
  type HandlerContext = {
@@ -122,6 +127,9 @@ function extractMethodMetadata(metadata: unknown, method: HttpMethod): MethodMet
122
127
  }
123
128
  }
124
129
  }
130
+ if (typeof source.skipModuleResourceUsageTracking === 'boolean') {
131
+ normalized.skipModuleResourceUsageTracking = source.skipModuleResourceUsageTracking
132
+ }
125
133
  return Object.keys(normalized).length > 0 ? normalized : null
126
134
  }
127
135
 
@@ -410,7 +418,18 @@ async function handleRequest(
410
418
 
411
419
  try {
412
420
  const handlerContext: HandlerContext = { params: match.params, auth }
413
- const response = await runWithCacheTenant(auth?.tenantId ?? null, () => handler(req, handlerContext))
421
+ const runHandler = () => runWithCacheTenant(auth?.tenantId ?? null, () => handler(req, handlerContext))
422
+ const response = methodMetadata?.skipModuleResourceUsageTracking !== true
423
+ ? await withModuleResourceUsage(
424
+ {
425
+ moduleId: match.route.moduleId,
426
+ surface: 'api',
427
+ operation: `${method} ${match.route.path}`,
428
+ resourceId: `${method} ${match.route.path}`,
429
+ },
430
+ runHandler,
431
+ )
432
+ : await runHandler()
414
433
  const finalResponse = authResolution.status === 'invalid' && response.status === 401
415
434
  ? clearStaffAuthCookies(response)
416
435
  : response