@open-mercato/cli 0.11.1-develop.8356.1.8aca009256 → 0.11.1-develop.8358.1.e97a6c9f63

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 (90) hide show
  1. package/dist/agentic/guides/module-facts.json +162 -162
  2. package/dist/agentic/guides/module-facts.v2.json +162 -162
  3. package/dist/agentic/guides/modules/agent_orchestrator/index.md +1 -1
  4. package/dist/agentic/guides/modules/ai_assistant/index.md +1 -1
  5. package/dist/agentic/guides/modules/api_docs/index.md +1 -1
  6. package/dist/agentic/guides/modules/api_keys/index.md +1 -1
  7. package/dist/agentic/guides/modules/attachments/index.md +1 -1
  8. package/dist/agentic/guides/modules/audit_logs/index.md +1 -1
  9. package/dist/agentic/guides/modules/auth/index.md +1 -1
  10. package/dist/agentic/guides/modules/availability/index.md +1 -1
  11. package/dist/agentic/guides/modules/business_rules/index.md +1 -1
  12. package/dist/agentic/guides/modules/carrier_inpost/index.md +1 -1
  13. package/dist/agentic/guides/modules/cart/index.md +1 -1
  14. package/dist/agentic/guides/modules/catalog/index.md +1 -1
  15. package/dist/agentic/guides/modules/channel_apns/index.md +1 -1
  16. package/dist/agentic/guides/modules/channel_discord/index.md +1 -1
  17. package/dist/agentic/guides/modules/channel_expo/index.md +1 -1
  18. package/dist/agentic/guides/modules/channel_fcm/index.md +1 -1
  19. package/dist/agentic/guides/modules/channel_gmail/index.md +1 -1
  20. package/dist/agentic/guides/modules/channel_imap/index.md +1 -1
  21. package/dist/agentic/guides/modules/channel_resend/index.md +1 -1
  22. package/dist/agentic/guides/modules/channel_ses/index.md +1 -1
  23. package/dist/agentic/guides/modules/channel_smtp/index.md +1 -1
  24. package/dist/agentic/guides/modules/checkout/index.md +1 -1
  25. package/dist/agentic/guides/modules/communication_channels/index.md +1 -1
  26. package/dist/agentic/guides/modules/configs/index.md +1 -1
  27. package/dist/agentic/guides/modules/content/index.md +1 -1
  28. package/dist/agentic/guides/modules/currencies/index.md +1 -1
  29. package/dist/agentic/guides/modules/customer_accounts/index.md +1 -1
  30. package/dist/agentic/guides/modules/customer_groups/index.md +1 -1
  31. package/dist/agentic/guides/modules/customers/index.md +1 -1
  32. package/dist/agentic/guides/modules/dashboards/index.md +1 -1
  33. package/dist/agentic/guides/modules/data_sync/index.md +1 -1
  34. package/dist/agentic/guides/modules/design_system/index.md +1 -1
  35. package/dist/agentic/guides/modules/devices/index.md +1 -1
  36. package/dist/agentic/guides/modules/dictionaries/index.md +1 -1
  37. package/dist/agentic/guides/modules/directory/index.md +1 -1
  38. package/dist/agentic/guides/modules/documents/index.md +1 -1
  39. package/dist/agentic/guides/modules/ecommerce/index.md +1 -1
  40. package/dist/agentic/guides/modules/entities/index.md +1 -1
  41. package/dist/agentic/guides/modules/eudr/index.md +1 -1
  42. package/dist/agentic/guides/modules/events/index.md +1 -1
  43. package/dist/agentic/guides/modules/feature_toggles/index.md +1 -1
  44. package/dist/agentic/guides/modules/forms/index.md +1 -1
  45. package/dist/agentic/guides/modules/gateway_autopay/index.md +1 -1
  46. package/dist/agentic/guides/modules/gateway_stripe/index.md +1 -1
  47. package/dist/agentic/guides/modules/gateway_tpay/index.md +1 -1
  48. package/dist/agentic/guides/modules/generators/index.md +1 -1
  49. package/dist/agentic/guides/modules/inbox_ops/index.md +1 -1
  50. package/dist/agentic/guides/modules/integrations/index.md +1 -1
  51. package/dist/agentic/guides/modules/messages/index.md +1 -1
  52. package/dist/agentic/guides/modules/notifications/index.md +1 -1
  53. package/dist/agentic/guides/modules/onboarding/index.md +1 -1
  54. package/dist/agentic/guides/modules/payment_gateways/index.md +1 -1
  55. package/dist/agentic/guides/modules/perspectives/index.md +1 -1
  56. package/dist/agentic/guides/modules/phone_calls/index.md +1 -1
  57. package/dist/agentic/guides/modules/planner/index.md +1 -1
  58. package/dist/agentic/guides/modules/portal/index.md +1 -1
  59. package/dist/agentic/guides/modules/progress/index.md +1 -1
  60. package/dist/agentic/guides/modules/promotions/index.md +1 -1
  61. package/dist/agentic/guides/modules/push_notifications/index.md +1 -1
  62. package/dist/agentic/guides/modules/query_index/index.md +1 -1
  63. package/dist/agentic/guides/modules/record_locks/index.md +1 -1
  64. package/dist/agentic/guides/modules/resources/index.md +1 -1
  65. package/dist/agentic/guides/modules/sales/index.md +1 -1
  66. package/dist/agentic/guides/modules/scheduler/index.md +1 -1
  67. package/dist/agentic/guides/modules/search/index.md +1 -1
  68. package/dist/agentic/guides/modules/security/index.md +1 -1
  69. package/dist/agentic/guides/modules/seeds/index.md +1 -1
  70. package/dist/agentic/guides/modules/shipping_carriers/index.md +1 -1
  71. package/dist/agentic/guides/modules/sso/index.md +1 -1
  72. package/dist/agentic/guides/modules/staff/index.md +1 -1
  73. package/dist/agentic/guides/modules/storage_s3/index.md +1 -1
  74. package/dist/agentic/guides/modules/sync_akeneo/index.md +1 -1
  75. package/dist/agentic/guides/modules/sync_excel/index.md +1 -1
  76. package/dist/agentic/guides/modules/system_status_overlays/index.md +1 -1
  77. package/dist/agentic/guides/modules/telemetry/index.md +1 -1
  78. package/dist/agentic/guides/modules/tillio/index.md +1 -1
  79. package/dist/agentic/guides/modules/translations/index.md +1 -1
  80. package/dist/agentic/guides/modules/warranty_claims/index.md +1 -1
  81. package/dist/agentic/guides/modules/webhooks/index.md +1 -1
  82. package/dist/agentic/guides/modules/wms/index.md +1 -1
  83. package/dist/agentic/guides/modules/workflows/index.md +1 -1
  84. package/dist/agentic/guides/reference-module-facts.json +1 -1
  85. package/dist/agentic/guides/upstream/manifest.json +1 -1
  86. package/dist/lib/testing/integration.js +3 -2
  87. package/dist/lib/testing/integration.js.map +2 -2
  88. package/package.json +7 -7
  89. package/src/lib/testing/__tests__/integration.test.ts +84 -10
  90. package/src/lib/testing/integration.ts +4 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-mercato/cli",
3
- "version": "0.11.1-develop.8356.1.8aca009256",
3
+ "version": "0.11.1-develop.8358.1.e97a6c9f63",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -60,10 +60,10 @@
60
60
  "@mikro-orm/decorators": "^7.1.14",
61
61
  "@mikro-orm/migrations": "^7.1.14",
62
62
  "@mikro-orm/postgresql": "^7.1.14",
63
- "@open-mercato/events": "0.11.1-develop.8356.1.8aca009256",
64
- "@open-mercato/queue": "0.11.1-develop.8356.1.8aca009256",
65
- "@open-mercato/shared": "0.11.1-develop.8356.1.8aca009256",
66
- "@open-mercato/telemetry": "0.11.1-develop.8356.1.8aca009256",
63
+ "@open-mercato/events": "0.11.1-develop.8358.1.e97a6c9f63",
64
+ "@open-mercato/queue": "0.11.1-develop.8358.1.e97a6c9f63",
65
+ "@open-mercato/shared": "0.11.1-develop.8358.1.e97a6c9f63",
66
+ "@open-mercato/telemetry": "0.11.1-develop.8358.1.e97a6c9f63",
67
67
  "cross-spawn": "^7.0.6",
68
68
  "minisearch": "7.2.0",
69
69
  "pg": "8.23.0",
@@ -75,10 +75,10 @@
75
75
  "typescript-js": "npm:typescript@6.0.3"
76
76
  },
77
77
  "peerDependencies": {
78
- "@open-mercato/shared": "0.11.1-develop.8356.1.8aca009256"
78
+ "@open-mercato/shared": "0.11.1-develop.8358.1.e97a6c9f63"
79
79
  },
80
80
  "devDependencies": {
81
- "@open-mercato/shared": "0.11.1-develop.8356.1.8aca009256",
81
+ "@open-mercato/shared": "0.11.1-develop.8358.1.e97a6c9f63",
82
82
  "@types/jest": "^30.0.0",
83
83
  "jest": "^30.4.2",
84
84
  "ts-jest": "^29.4.12"
@@ -72,8 +72,8 @@ const mockHealthyReadinessFetch = (
72
72
  }
73
73
  return { status: 401, ok: false, text: async () => '' } as unknown as Response
74
74
  }
75
- if (url.includes('/api/customers/people?pageSize=1')) {
76
- return { status: 200, ok: true, text: async () => JSON.stringify({ items: [] }) } as unknown as Response
75
+ if (url.endsWith('/api/auth/profile')) {
76
+ return { status: 200, ok: true, text: async () => JSON.stringify({ email: 'admin@acme.com', name: null, roles: ['admin'] }) } as unknown as Response
77
77
  }
78
78
  if (url.endsWith('/login')) {
79
79
  const response = overrides.loginPageResponse
@@ -704,6 +704,80 @@ describe('waitForApplicationReadiness', () => {
704
704
  const makeFakeProcess = (): ChildProcess => new EventEmitter() as unknown as ChildProcess
705
705
  const sleep = (ms: number) => new Promise<void>((resolve) => setTimeout(resolve, ms))
706
706
 
707
+ const mockAppWithoutCustomersModule = (profileStatus: number) => {
708
+ const requestedUrls: string[] = []
709
+ let profileAuthorization: string | null = null
710
+ const fetchSpy = jest.spyOn(global, 'fetch').mockImplementation(async (input, init) => {
711
+ const url = typeof input === 'string' ? input : String(input)
712
+ requestedUrls.push(url)
713
+ if (url.endsWith('/api/auth/login')) {
714
+ return {
715
+ status: 200,
716
+ ok: true,
717
+ headers: makeSetCookieHeaders([
718
+ 'auth_token=test-auth-token; Path=/; HttpOnly; SameSite=Lax',
719
+ 'session_token=test-session-token; Path=/; HttpOnly; SameSite=Lax',
720
+ ]),
721
+ text: async () => JSON.stringify({ token: 'test-admin-token' }),
722
+ } as unknown as Response
723
+ }
724
+ if (url.endsWith('/api/auth/profile')) {
725
+ const headers = init?.headers as Record<string, string> | undefined
726
+ profileAuthorization = headers?.Authorization ?? null
727
+ return {
728
+ status: profileStatus,
729
+ ok: profileStatus === 200,
730
+ text: async () => (profileStatus === 200 ? JSON.stringify({ email: 'admin@acme.com', name: null, roles: ['admin'] }) : ''),
731
+ } as unknown as Response
732
+ }
733
+ if (url.endsWith('/login')) {
734
+ return {
735
+ status: 200,
736
+ ok: true,
737
+ text: async () => '<!doctype html><script src="/_next/static/chunks/app.js"></script>',
738
+ } as unknown as Response
739
+ }
740
+ if (url.endsWith('/backend') || url.includes('/_next/static/')) {
741
+ return { status: 200, ok: true, text: async () => '' } as unknown as Response
742
+ }
743
+ return { status: 404, ok: false, text: async () => '' } as unknown as Response
744
+ })
745
+ return { fetchSpy, requestedUrls, getProfileAuthorization: () => profileAuthorization }
746
+ }
747
+
748
+ it('becomes ready without the customers module by probing the always-present auth profile route', async () => {
749
+ const { fetchSpy, requestedUrls, getProfileAuthorization } = mockAppWithoutCustomersModule(200)
750
+
751
+ try {
752
+ await waitForApplicationReadiness('http://127.0.0.1:5001', makeFakeProcess(), {
753
+ timeoutMs: 1_000,
754
+ intervalMs: 5,
755
+ stabilizationMs: 10,
756
+ })
757
+ expect(requestedUrls).toContain('http://127.0.0.1:5001/api/auth/profile')
758
+ expect(requestedUrls.some((url) => url.includes('/api/customers/'))).toBe(false)
759
+ expect(getProfileAuthorization()).toBe('Bearer test-admin-token')
760
+ } finally {
761
+ fetchSpy.mockRestore()
762
+ }
763
+ })
764
+
765
+ it('reports the auth profile probe status when the authenticated API check fails', async () => {
766
+ const { fetchSpy } = mockAppWithoutCustomersModule(401)
767
+
768
+ try {
769
+ await expect(
770
+ waitForApplicationReadiness('http://127.0.0.1:5001', makeFakeProcess(), {
771
+ timeoutMs: 50,
772
+ intervalMs: 5,
773
+ stabilizationMs: 10,
774
+ }),
775
+ ).rejects.toThrow(/Authenticated GET \/api\/auth\/profile returned 401/)
776
+ } finally {
777
+ fetchSpy.mockRestore()
778
+ }
779
+ })
780
+
707
781
  it('verifies backend browser navigation with cookies returned by login', async () => {
708
782
  let backendCookieHeader: string | null = null
709
783
 
@@ -732,8 +806,8 @@ describe('waitForApplicationReadiness', () => {
732
806
  text: async () => '<!doctype html><script src="/_next/static/chunks/app.js"></script>',
733
807
  } as unknown as Response
734
808
  }
735
- if (url.includes('/api/customers/people')) {
736
- return { status: 200, ok: true, text: async () => JSON.stringify({ items: [] }) } as unknown as Response
809
+ if (url.endsWith('/api/auth/profile')) {
810
+ return { status: 200, ok: true, text: async () => JSON.stringify({ email: 'admin@acme.com', name: null, roles: ['admin'] }) } as unknown as Response
737
811
  }
738
812
  if (url.endsWith('/backend')) {
739
813
  backendCookieHeader = typeof init?.headers === 'object'
@@ -785,8 +859,8 @@ describe('waitForApplicationReadiness', () => {
785
859
  text: async () => '<!doctype html><script src="/_next/static/chunks/app.js"></script>',
786
860
  } as unknown as Response
787
861
  }
788
- if (url.includes('/api/customers/people')) {
789
- return { status: 200, ok: true, text: async () => JSON.stringify({ items: [] }) } as unknown as Response
862
+ if (url.endsWith('/api/auth/profile')) {
863
+ return { status: 200, ok: true, text: async () => JSON.stringify({ email: 'admin@acme.com', name: null, roles: ['admin'] }) } as unknown as Response
790
864
  }
791
865
  if (url.endsWith('/backend')) {
792
866
  return {
@@ -864,8 +938,8 @@ describe('waitForApplicationReadiness', () => {
864
938
  text: async () => '<!doctype html><script src="/_next/static/chunks/app.js"></script>',
865
939
  } as unknown as Response
866
940
  }
867
- if (url.includes('/api/customers/people')) {
868
- return { status: 200, ok: true, text: async () => JSON.stringify({ items: [] }) } as unknown as Response
941
+ if (url.endsWith('/api/auth/profile')) {
942
+ return { status: 200, ok: true, text: async () => JSON.stringify({ email: 'admin@acme.com', name: null, roles: ['admin'] }) } as unknown as Response
869
943
  }
870
944
  if (url.endsWith('/backend')) {
871
945
  return {
@@ -938,8 +1012,8 @@ describe('waitForApplicationReadiness', () => {
938
1012
  text: async () => JSON.stringify({ token: 'token' }),
939
1013
  } as unknown as Response
940
1014
  }
941
- if (url.includes('/api/customers/people')) {
942
- return { status: 200, ok: true, text: async () => JSON.stringify({ items: [] }) } as unknown as Response
1015
+ if (url.endsWith('/api/auth/profile')) {
1016
+ return { status: 200, ok: true, text: async () => JSON.stringify({ email: 'admin@acme.com', name: null, roles: ['admin'] }) } as unknown as Response
943
1017
  }
944
1018
  if (url.endsWith('/backend')) {
945
1019
  return { status: 200, ok: true, text: async () => '' } as unknown as Response
@@ -363,6 +363,7 @@ const FOLDER_TO_CATEGORY_CODE: Record<string, string> = {
363
363
  integration: 'INT',
364
364
  }
365
365
  const BACKEND_BROWSER_AUTH_REDIRECT_LIMIT = 6
366
+ const AUTHENTICATED_API_PROBE_PATH = '/api/auth/profile'
366
367
  const BUILD_CACHE_STATE_VERSION = 2
367
368
  const BUILD_CACHE_ENV_KEYS = [
368
369
  'NODE_ENV',
@@ -1539,7 +1540,7 @@ async function probeAuthenticatedApi(baseUrl: string): Promise<AuthenticatedApiP
1539
1540
  }
1540
1541
  }
1541
1542
 
1542
- const apiResponse = await probeFetch(`${baseUrl}/api/customers/people?pageSize=1`, {
1543
+ const apiResponse = await probeFetch(`${baseUrl}${AUTHENTICATED_API_PROBE_PATH}`, {
1543
1544
  headers: {
1544
1545
  Authorization: `Bearer ${token}`,
1545
1546
  },
@@ -1551,8 +1552,8 @@ async function probeAuthenticatedApi(baseUrl: string): Promise<AuthenticatedApiP
1551
1552
  apiStatus: apiResponse.status,
1552
1553
  healthy,
1553
1554
  detail: healthy
1554
- ? 'Authenticated GET /api/customers/people returned 200'
1555
- : `Authenticated GET /api/customers/people returned ${apiResponse.status}`,
1555
+ ? `Authenticated GET ${AUTHENTICATED_API_PROBE_PATH} returned 200`
1556
+ : `Authenticated GET ${AUTHENTICATED_API_PROBE_PATH} returned ${apiResponse.status}`,
1556
1557
  }
1557
1558
  } catch (error) {
1558
1559
  const message = error instanceof Error ? error.message : String(error)