@wildo-ai/saas-backend-lib 1.1.8 → 1.1.9

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 (174) hide show
  1. package/dist/esm/data-seeding/models/data-seed.shared.schemas.d.ts +8 -0
  2. package/dist/esm/data-seeding/models/data-seed.shared.schemas.d.ts.map +1 -1
  3. package/dist/esm/data-seeding/models/data-seed.shared.schemas.js +17 -0
  4. package/dist/esm/data-seeding/models/data-seed.shared.schemas.js.map +1 -1
  5. package/dist/esm/data-seeding/services/data-seed-application-bootstrap.backend.d.ts.map +1 -1
  6. package/dist/esm/data-seeding/services/data-seed-application-bootstrap.backend.js +9 -1
  7. package/dist/esm/data-seeding/services/data-seed-application-bootstrap.backend.js.map +1 -1
  8. package/dist/esm/data-seeding/services/data-seed-environment-admission.backend.d.ts +23 -0
  9. package/dist/esm/data-seeding/services/data-seed-environment-admission.backend.d.ts.map +1 -0
  10. package/dist/esm/data-seeding/services/data-seed-environment-admission.backend.js +25 -0
  11. package/dist/esm/data-seeding/services/data-seed-environment-admission.backend.js.map +1 -0
  12. package/dist/esm/databases/services/postgresql-migration-runner.backend.d.ts +6 -0
  13. package/dist/esm/databases/services/postgresql-migration-runner.backend.d.ts.map +1 -1
  14. package/dist/esm/databases/services/postgresql-migration-runner.backend.js +8 -1
  15. package/dist/esm/databases/services/postgresql-migration-runner.backend.js.map +1 -1
  16. package/dist/esm/external-providers/services/external-providers-registry.backend.service.d.ts +0 -1
  17. package/dist/esm/external-providers/services/external-providers-registry.backend.service.d.ts.map +1 -1
  18. package/dist/esm/external-providers/services/external-providers-registry.backend.service.js +4 -39
  19. package/dist/esm/external-providers/services/external-providers-registry.backend.service.js.map +1 -1
  20. package/dist/esm/flows-actors/services/agents.backend.service.d.ts +15 -4
  21. package/dist/esm/flows-actors/services/agents.backend.service.d.ts.map +1 -1
  22. package/dist/esm/flows-actors/services/agents.backend.service.js +21 -11
  23. package/dist/esm/flows-actors/services/agents.backend.service.js.map +1 -1
  24. package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.d.ts +47 -2
  25. package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.d.ts.map +1 -1
  26. package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.js +56 -8
  27. package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.js.map +1 -1
  28. package/dist/esm/queue/job-consumer.backend.service.d.ts.map +1 -1
  29. package/dist/esm/queue/job-consumer.backend.service.js +21 -8
  30. package/dist/esm/queue/job-consumer.backend.service.js.map +1 -1
  31. package/dist/esm/queue/job-status-tracking.backend.service.d.ts.map +1 -1
  32. package/dist/esm/queue/job-status-tracking.backend.service.js +4 -1
  33. package/dist/esm/queue/job-status-tracking.backend.service.js.map +1 -1
  34. package/dist/esm/queue/queue.backend.service.d.ts +14 -0
  35. package/dist/esm/queue/queue.backend.service.d.ts.map +1 -1
  36. package/dist/esm/queue/queue.backend.service.js +68 -12
  37. package/dist/esm/queue/queue.backend.service.js.map +1 -1
  38. package/dist/esm/queue/scheduled-evidence-coverage.backend.d.ts +8 -0
  39. package/dist/esm/queue/scheduled-evidence-coverage.backend.d.ts.map +1 -1
  40. package/dist/esm/queue/scheduled-evidence-coverage.backend.js +20 -2
  41. package/dist/esm/queue/scheduled-evidence-coverage.backend.js.map +1 -1
  42. package/dist/esm/queue/scheduled-execution.backend.service.d.ts +44 -1
  43. package/dist/esm/queue/scheduled-execution.backend.service.d.ts.map +1 -1
  44. package/dist/esm/queue/scheduled-execution.backend.service.js +180 -10
  45. package/dist/esm/queue/scheduled-execution.backend.service.js.map +1 -1
  46. package/dist/esm/queue/scheduled-message-verifier.backend.service.d.ts +73 -21
  47. package/dist/esm/queue/scheduled-message-verifier.backend.service.d.ts.map +1 -1
  48. package/dist/esm/queue/scheduled-message-verifier.backend.service.js +162 -88
  49. package/dist/esm/queue/scheduled-message-verifier.backend.service.js.map +1 -1
  50. package/dist/esm/runtime/services/start-application.backend.service.d.ts.map +1 -1
  51. package/dist/esm/runtime/services/start-application.backend.service.js +16 -1
  52. package/dist/esm/runtime/services/start-application.backend.service.js.map +1 -1
  53. package/package.json +10 -10
  54. package/dist/esm/__tests__/fixture-deep-partial.d.ts +0 -18
  55. package/dist/esm/__tests__/fixture-deep-partial.d.ts.map +0 -1
  56. package/dist/esm/__tests__/fixture-deep-partial.js +0 -1
  57. package/dist/esm/__tests__/fixture-deep-partial.js.map +0 -1
  58. package/dist/esm/__tests__/integration/redis-integration-gate.d.ts +0 -26
  59. package/dist/esm/__tests__/integration/redis-integration-gate.d.ts.map +0 -1
  60. package/dist/esm/__tests__/integration/redis-integration-gate.js +0 -105
  61. package/dist/esm/__tests__/integration/redis-integration-gate.js.map +0 -1
  62. package/dist/esm/__tests__/setup.d.ts +0 -7
  63. package/dist/esm/__tests__/setup.d.ts.map +0 -1
  64. package/dist/esm/__tests__/setup.js +0 -14
  65. package/dist/esm/__tests__/setup.js.map +0 -1
  66. package/dist/esm/__tests__/test-container.d.ts +0 -41
  67. package/dist/esm/__tests__/test-container.d.ts.map +0 -1
  68. package/dist/esm/__tests__/test-container.js +0 -98
  69. package/dist/esm/__tests__/test-container.js.map +0 -1
  70. package/dist/esm/base-classes/services/__tests__/mock-resource-operation-helper.service.d.ts +0 -47
  71. package/dist/esm/base-classes/services/__tests__/mock-resource-operation-helper.service.d.ts.map +0 -1
  72. package/dist/esm/base-classes/services/__tests__/mock-resource-operation-helper.service.js +0 -82
  73. package/dist/esm/base-classes/services/__tests__/mock-resource-operation-helper.service.js.map +0 -1
  74. package/dist/esm/base-classes/services/repositories/__tests__/method-span-scan.guard-helpers.d.ts +0 -57
  75. package/dist/esm/base-classes/services/repositories/__tests__/method-span-scan.guard-helpers.d.ts.map +0 -1
  76. package/dist/esm/base-classes/services/repositories/__tests__/method-span-scan.guard-helpers.js +0 -172
  77. package/dist/esm/base-classes/services/repositories/__tests__/method-span-scan.guard-helpers.js.map +0 -1
  78. package/dist/esm/base-classes/services/repositories/__tests__/repositories-registry-infrastructure-read.double.d.ts +0 -41
  79. package/dist/esm/base-classes/services/repositories/__tests__/repositories-registry-infrastructure-read.double.d.ts.map +0 -1
  80. package/dist/esm/base-classes/services/repositories/__tests__/repositories-registry-infrastructure-read.double.js +0 -54
  81. package/dist/esm/base-classes/services/repositories/__tests__/repositories-registry-infrastructure-read.double.js.map +0 -1
  82. package/dist/esm/billing/services/__tests__/subscription-provider-projection.test-double.d.ts +0 -20
  83. package/dist/esm/billing/services/__tests__/subscription-provider-projection.test-double.d.ts.map +0 -1
  84. package/dist/esm/billing/services/__tests__/subscription-provider-projection.test-double.js +0 -33
  85. package/dist/esm/billing/services/__tests__/subscription-provider-projection.test-double.js.map +0 -1
  86. package/dist/esm/billing/services/custom-impl/__tests__/plan-change-confirmation.fixture.d.ts +0 -22
  87. package/dist/esm/billing/services/custom-impl/__tests__/plan-change-confirmation.fixture.d.ts.map +0 -1
  88. package/dist/esm/billing/services/custom-impl/__tests__/plan-change-confirmation.fixture.js +0 -92
  89. package/dist/esm/billing/services/custom-impl/__tests__/plan-change-confirmation.fixture.js.map +0 -1
  90. package/dist/esm/billing/services/custom-impl/__tests__/subscription-keyed-mutation.fixture.d.ts +0 -15
  91. package/dist/esm/billing/services/custom-impl/__tests__/subscription-keyed-mutation.fixture.d.ts.map +0 -1
  92. package/dist/esm/billing/services/custom-impl/__tests__/subscription-keyed-mutation.fixture.js +0 -61
  93. package/dist/esm/billing/services/custom-impl/__tests__/subscription-keyed-mutation.fixture.js.map +0 -1
  94. package/dist/esm/billing/services/webhooks/__tests__/billing-event-authority.test-double.d.ts +0 -21
  95. package/dist/esm/billing/services/webhooks/__tests__/billing-event-authority.test-double.d.ts.map +0 -1
  96. package/dist/esm/billing/services/webhooks/__tests__/billing-event-authority.test-double.js +0 -32
  97. package/dist/esm/billing/services/webhooks/__tests__/billing-event-authority.test-double.js.map +0 -1
  98. package/dist/esm/billing/services/webhooks/__tests__/settlement-ledger.test-double.d.ts +0 -52
  99. package/dist/esm/billing/services/webhooks/__tests__/settlement-ledger.test-double.d.ts.map +0 -1
  100. package/dist/esm/billing/services/webhooks/__tests__/settlement-ledger.test-double.js +0 -74
  101. package/dist/esm/billing/services/webhooks/__tests__/settlement-ledger.test-double.js.map +0 -1
  102. package/dist/esm/config/services/__tests__/mock-app-configuration.service.d.ts +0 -60
  103. package/dist/esm/config/services/__tests__/mock-app-configuration.service.d.ts.map +0 -1
  104. package/dist/esm/config/services/__tests__/mock-app-configuration.service.js +0 -156
  105. package/dist/esm/config/services/__tests__/mock-app-configuration.service.js.map +0 -1
  106. package/dist/esm/config/services/__tests__/startup-validator-resources-registry.double.d.ts +0 -31
  107. package/dist/esm/config/services/__tests__/startup-validator-resources-registry.double.d.ts.map +0 -1
  108. package/dist/esm/config/services/__tests__/startup-validator-resources-registry.double.js +0 -47
  109. package/dist/esm/config/services/__tests__/startup-validator-resources-registry.double.js.map +0 -1
  110. package/dist/esm/databases/services/__tests__/mock-mongoose-model.service.d.ts +0 -20
  111. package/dist/esm/databases/services/__tests__/mock-mongoose-model.service.d.ts.map +0 -1
  112. package/dist/esm/databases/services/__tests__/mock-mongoose-model.service.js +0 -424
  113. package/dist/esm/databases/services/__tests__/mock-mongoose-model.service.js.map +0 -1
  114. package/dist/esm/databases/services/__tests__/mock-zod-mongoose-schema-convertor.service.d.ts +0 -19
  115. package/dist/esm/databases/services/__tests__/mock-zod-mongoose-schema-convertor.service.d.ts.map +0 -1
  116. package/dist/esm/databases/services/__tests__/mock-zod-mongoose-schema-convertor.service.js +0 -49
  117. package/dist/esm/databases/services/__tests__/mock-zod-mongoose-schema-convertor.service.js.map +0 -1
  118. package/dist/esm/flows-actors/services/__tests__/pending-decision.fixtures.d.ts +0 -43
  119. package/dist/esm/flows-actors/services/__tests__/pending-decision.fixtures.d.ts.map +0 -1
  120. package/dist/esm/flows-actors/services/__tests__/pending-decision.fixtures.js +0 -61
  121. package/dist/esm/flows-actors/services/__tests__/pending-decision.fixtures.js.map +0 -1
  122. package/dist/esm/inbound/services/__tests__/support/in-memory-infrastructure-repositories.d.ts +0 -25
  123. package/dist/esm/inbound/services/__tests__/support/in-memory-infrastructure-repositories.d.ts.map +0 -1
  124. package/dist/esm/inbound/services/__tests__/support/in-memory-infrastructure-repositories.js +0 -92
  125. package/dist/esm/inbound/services/__tests__/support/in-memory-infrastructure-repositories.js.map +0 -1
  126. package/dist/esm/meta-workflows/services/__tests__/fixtures/meta-workflow-evaluation-treatment.test-fixture.d.ts +0 -7
  127. package/dist/esm/meta-workflows/services/__tests__/fixtures/meta-workflow-evaluation-treatment.test-fixture.d.ts.map +0 -1
  128. package/dist/esm/meta-workflows/services/__tests__/fixtures/meta-workflow-evaluation-treatment.test-fixture.js +0 -194
  129. package/dist/esm/meta-workflows/services/__tests__/fixtures/meta-workflow-evaluation-treatment.test-fixture.js.map +0 -1
  130. package/dist/esm/monitoring/logger/services/__tests__/mock-logger.service.d.ts +0 -34
  131. package/dist/esm/monitoring/logger/services/__tests__/mock-logger.service.d.ts.map +0 -1
  132. package/dist/esm/monitoring/logger/services/__tests__/mock-logger.service.js +0 -59
  133. package/dist/esm/monitoring/logger/services/__tests__/mock-logger.service.js.map +0 -1
  134. package/dist/esm/monitoring/observability/services/__tests__/mock-metrics.service.d.ts +0 -48
  135. package/dist/esm/monitoring/observability/services/__tests__/mock-metrics.service.d.ts.map +0 -1
  136. package/dist/esm/monitoring/observability/services/__tests__/mock-metrics.service.js +0 -53
  137. package/dist/esm/monitoring/observability/services/__tests__/mock-metrics.service.js.map +0 -1
  138. package/dist/esm/notifications/services/__tests__/fixtures/personal-notification-browser/bundle.d.ts +0 -3
  139. package/dist/esm/notifications/services/__tests__/fixtures/personal-notification-browser/bundle.d.ts.map +0 -1
  140. package/dist/esm/notifications/services/__tests__/fixtures/personal-notification-browser/bundle.js +0 -19
  141. package/dist/esm/notifications/services/__tests__/fixtures/personal-notification-browser/bundle.js.map +0 -1
  142. package/dist/esm/notifications/services/__tests__/fixtures/personal-notification-browser/host.d.ts +0 -51
  143. package/dist/esm/notifications/services/__tests__/fixtures/personal-notification-browser/host.d.ts.map +0 -1
  144. package/dist/esm/notifications/services/__tests__/fixtures/personal-notification-browser/host.js +0 -24
  145. package/dist/esm/notifications/services/__tests__/fixtures/personal-notification-browser/host.js.map +0 -1
  146. package/dist/esm/notifications/services/__tests__/recipient-language.test-double.d.ts +0 -8
  147. package/dist/esm/notifications/services/__tests__/recipient-language.test-double.d.ts.map +0 -1
  148. package/dist/esm/notifications/services/__tests__/recipient-language.test-double.js +0 -9
  149. package/dist/esm/notifications/services/__tests__/recipient-language.test-double.js.map +0 -1
  150. package/dist/esm/pdf-templates/__tests__/fixtures/tiny-pdf-template.fixture.d.ts +0 -10
  151. package/dist/esm/pdf-templates/__tests__/fixtures/tiny-pdf-template.fixture.d.ts.map +0 -1
  152. package/dist/esm/pdf-templates/__tests__/fixtures/tiny-pdf-template.fixture.js +0 -18
  153. package/dist/esm/pdf-templates/__tests__/fixtures/tiny-pdf-template.fixture.js.map +0 -1
  154. package/dist/esm/security/api-keys/__tests__/api-key-usage-redis.double.d.ts +0 -11
  155. package/dist/esm/security/api-keys/__tests__/api-key-usage-redis.double.d.ts.map +0 -1
  156. package/dist/esm/security/api-keys/__tests__/api-key-usage-redis.double.js +0 -34
  157. package/dist/esm/security/api-keys/__tests__/api-key-usage-redis.double.js.map +0 -1
  158. package/dist/esm/security/authentications/__tests__/registration-onboarding.harness.d.ts +0 -105
  159. package/dist/esm/security/authentications/__tests__/registration-onboarding.harness.d.ts.map +0 -1
  160. package/dist/esm/security/authentications/__tests__/registration-onboarding.harness.js +0 -140
  161. package/dist/esm/security/authentications/__tests__/registration-onboarding.harness.js.map +0 -1
  162. package/dist/esm/security/authentications/services/__tests__/oauth-provider-audit-spies.mock.d.ts +0 -35
  163. package/dist/esm/security/authentications/services/__tests__/oauth-provider-audit-spies.mock.d.ts.map +0 -1
  164. package/dist/esm/security/authentications/services/__tests__/oauth-provider-audit-spies.mock.js +0 -46
  165. package/dist/esm/security/authentications/services/__tests__/oauth-provider-audit-spies.mock.js.map +0 -1
  166. package/dist/esm/security/connected-accounts/__tests__/support/real-connection-client-methods.d.ts +0 -2
  167. package/dist/esm/security/connected-accounts/__tests__/support/real-connection-client-methods.d.ts.map +0 -1
  168. package/dist/esm/security/connected-accounts/__tests__/support/real-connection-client-methods.js +0 -18
  169. package/dist/esm/security/connected-accounts/__tests__/support/real-connection-client-methods.js.map +0 -1
  170. package/dist/esm/systems-of-record/credentials/__tests__/certificate-fixtures.d.ts +0 -20
  171. package/dist/esm/systems-of-record/credentials/__tests__/certificate-fixtures.d.ts.map +0 -1
  172. package/dist/esm/systems-of-record/credentials/__tests__/certificate-fixtures.js +0 -56
  173. package/dist/esm/systems-of-record/credentials/__tests__/certificate-fixtures.js.map +0 -1
  174. package/dist/tsconfig.build.tsbuildinfo +0 -1
@@ -1,49 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- /**
8
- * Vitest-oriented mock Zod → Mongoose convertor for integration tests (`vi.fn` on methods).
9
- *
10
- * **Naming**: `mock-*.service.ts` — canonical mock module, not a test suite.
11
- * Plain `.ts` keeps it barrel-compilable, and Vitest also excludes these files
12
- * explicitly as a defensive guard.
13
- */
14
- import 'reflect-metadata';
15
- import { injectable } from 'inversify';
16
- import { vi } from 'vitest';
17
- import { isPrimaryKey } from '@wildo-ai/zod-decorators';
18
- import { createMockModel } from './mock-mongoose-model.service.js';
19
- import { resetMockMongoTransactions } from './mock-mongo-transaction-registry.service.js';
20
- let MockZodToMongooseSchemaConvertorBackendService = class MockZodToMongooseSchemaConvertorBackendService {
21
- models = new Map();
22
- convertResourceConfigurationToModel = vi.fn((resourceConfig, _options) => {
23
- const modelName = resourceConfig.resourceIdentifier;
24
- if (!this.models.has(modelName)) {
25
- // Detected the same way the real convertor does — a non-`_id` field carrying `.isPrimaryKey()`
26
- // — so the mock exposes the surrogate virtual instead of silently dropping it.
27
- const shape = resourceConfig?.mainSchema?.shape ?? {};
28
- const surrogatePrimaryKeyFieldName = Object.keys(shape).find((fieldName) => fieldName !== '_id' && shape[fieldName] && isPrimaryKey(shape[fieldName]));
29
- this.models.set(modelName, createMockModel(modelName, surrogatePrimaryKeyFieldName));
30
- }
31
- return {
32
- mainModel: this.models.get(modelName),
33
- inheritanceSchemas: [],
34
- };
35
- });
36
- getModel(name) {
37
- return this.models.get(name);
38
- }
39
- reset() {
40
- this.convertResourceConfigurationToModel.mockClear();
41
- this.models.clear();
42
- resetMockMongoTransactions();
43
- }
44
- };
45
- MockZodToMongooseSchemaConvertorBackendService = __decorate([
46
- injectable()
47
- ], MockZodToMongooseSchemaConvertorBackendService);
48
- export { MockZodToMongooseSchemaConvertorBackendService };
49
- //# sourceMappingURL=mock-zod-mongoose-schema-convertor.service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mock-zod-mongoose-schema-convertor.service.js","sourceRoot":"","sources":["../../../../../../src/databases/services/__tests__/mock-zod-mongoose-schema-convertor.service.ts"],"names":[],"mappings":";;;;;;AAAA;;;;;;GAMG;AACH,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,OAAO,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AAGhF,IAAM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tests (`vi.fn` on methods).\n *\n * **Naming**: `mock-*.service.ts` — canonical mock module, not a test suite.\n * Plain `.ts` keeps it barrel-compilable, and Vitest also excludes these files\n * explicitly as a defensive guard.\n */\nimport 'reflect-metadata';\nimport { injectable } from 'inversify';\nimport type { Model } from 'mongoose';\nimport { vi } from 'vitest';\nimport { isPrimaryKey } from '@wildo-ai/zod-decorators';\nimport { createMockModel } from './mock-mongoose-model.service';\nimport { resetMockMongoTransactions } from './mock-mongo-transaction-registry.service';\n\n@injectable()\nexport class MockZodToMongooseSchemaConvertorBackendService {\n private models = new Map<string, Model<any>>();\n\n convertResourceConfigurationToModel = vi.fn((resourceConfig: any, _options?: any) => {\n const modelName = resourceConfig.resourceIdentifier;\n\n if (!this.models.has(modelName)) {\n // Detected the same way the real convertor does — a non-`_id` field carrying `.isPrimaryKey()`\n // — so the mock exposes the surrogate virtual instead of silently dropping it.\n const shape = (resourceConfig?.mainSchema as any)?.shape ?? {};\n const surrogatePrimaryKeyFieldName = Object.keys(shape).find(\n (fieldName) => fieldName !== '_id' && shape[fieldName] && isPrimaryKey(shape[fieldName]),\n );\n this.models.set(modelName, createMockModel(modelName, surrogatePrimaryKeyFieldName));\n }\n\n return {\n mainModel: this.models.get(modelName)!,\n inheritanceSchemas: [],\n };\n });\n\n getModel(name: string): Model<any> | undefined {\n return this.models.get(name);\n }\n\n reset() {\n this.convertResourceConfigurationToModel.mockClear();\n this.models.clear();\n resetMockMongoTransactions();\n }\n}\n"]}
@@ -1,43 +0,0 @@
1
- import { HumanDecision_RouteKind } from '@wildo-ai/saas-models';
2
- import { DecisionRequesterAuthorityStanding } from '../../../runtime/services/execution-context-creator.backend.service';
3
- export declare const DECISION_REF = "6f1b0c55-5a3e-4d4b-9d38-0e7c1a2b3c4d";
4
- /** A row paused on a decision, with its route and requester stamped as `persistApprovalSuspension` writes them. */
5
- export declare function pausedDecisionRow(input: {
6
- readonly blob: string;
7
- readonly executionId?: string;
8
- readonly systemRef?: string;
9
- readonly ownerUserId?: string;
10
- readonly requesterUserId?: string;
11
- readonly routeKind?: HumanDecision_RouteKind;
12
- readonly eligibleRole?: string;
13
- readonly organizationId?: string;
14
- readonly assigneeUserId?: string;
15
- readonly routeVersion?: number;
16
- readonly decisionRef?: string;
17
- readonly expiresAt?: Date;
18
- }): Record<string, unknown>;
19
- /**
20
- * An `ExecutionContextCreator` double whose requester re-check answers HOLDS with `requesterAuth` — the
21
- * authority the resumed tool must run under. Pass `lapsedReason` to make the requester's authority lapse.
22
- */
23
- export declare function requesterRebuildDouble(requesterAuth: unknown, lapsedReason?: string): {
24
- rebuildDecisionRequesterAuthority: import("vitest").Mock<unknown[], Promise<{
25
- standing: DecisionRequesterAuthorityStanding;
26
- reason: string;
27
- auth?: undefined;
28
- } | {
29
- standing: DecisionRequesterAuthorityStanding;
30
- auth: unknown;
31
- reason?: undefined;
32
- }>>;
33
- };
34
- /** The six decision emitters, each a spy. */
35
- export declare function decisionAuditDouble(): {
36
- logHumanDecisionRequested: import("vitest").Mock<unknown[], Promise<void>>;
37
- logHumanDecisionResolved: import("vitest").Mock<unknown[], Promise<void>>;
38
- logHumanDecisionReassigned: import("vitest").Mock<unknown[], Promise<void>>;
39
- logHumanDecisionEscalated: import("vitest").Mock<unknown[], Promise<void>>;
40
- logHumanDecisionClaimed: import("vitest").Mock<unknown[], Promise<void>>;
41
- logHumanDecisionAnswerRefused: import("vitest").Mock<unknown[], Promise<void>>;
42
- };
43
- //# sourceMappingURL=pending-decision.fixtures.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pending-decision.fixtures.d.ts","sourceRoot":"","sources":["../../../../../../src/flows-actors/services/__tests__/pending-decision.fixtures.ts"],"names":[],"mappings":"AAQA,OAAO,EAKL,uBAAuB,EACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,kCAAkC,EAAE,MAAM,+EAA+E,CAAC;AAEnI,eAAO,MAAM,YAAY,yCAAyC,CAAC;AAEnE,mHAAmH;AACnH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,SAAS,CAAC,EAAE,uBAAuB,CAAC;IAC7C,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC;CAC3B,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAyB1B;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE,MAAM;;;;;;;;;;EAMnF;AAED,6CAA6C;AAC7C,wBAAgB,mBAAmB;;;;;;;EASlC"}
@@ -1,61 +0,0 @@
1
- /**
2
- * Test doubles for a turn paused on a ROUTED decision (#1594), shared by every suite that answers one.
3
- *
4
- * A paused row carries its route and requester in columns, and the answer path reads them back from the
5
- * row — never from whoever answers. A fixture that omitted them would be a turn no door can answer, so
6
- * the doubles below build the whole shape once rather than letting each suite re-derive it.
7
- */
8
- import { vi } from 'vitest';
9
- import { FLOWS_ACTORS_DEFAULT_AGENT_INSTANCE, FLOWS_ACTORS_NO_MACHINE_CREDENTIAL, FlowsActors_Status, HumanDecision_RequesterKind, HumanDecision_RouteKind, } from '@wildo-ai/saas-models';
10
- import { DecisionRequesterAuthorityStanding } from '../../../runtime/services/execution-context-creator.backend.service.js';
11
- export const DECISION_REF = '6f1b0c55-5a3e-4d4b-9d38-0e7c1a2b3c4d';
12
- /** A row paused on a decision, with its route and requester stamped as `persistApprovalSuspension` writes them. */
13
- export function pausedDecisionRow(input) {
14
- const requesterUserId = input.requesterUserId ?? input.ownerUserId ?? 'u1';
15
- return {
16
- executionId: input.executionId ?? 'exec-1',
17
- systemRef: input.systemRef ?? 'assistant',
18
- userId: input.ownerUserId ?? 'u1',
19
- machineCredentialId: FLOWS_ACTORS_NO_MACHINE_CREDENTIAL,
20
- resourceServerInstanceRef: FLOWS_ACTORS_DEFAULT_AGENT_INSTANCE,
21
- status: FlowsActors_Status.AWAITING_APPROVAL,
22
- pausedApproval: input.blob,
23
- messages: [],
24
- pendingDecisionRef: input.decisionRef ?? DECISION_REF,
25
- pendingDecisionRouteKind: input.routeKind ?? HumanDecision_RouteKind.OWNER,
26
- pendingDecisionEligibleRole: input.eligibleRole ?? null,
27
- pendingDecisionOrganizationId: input.organizationId ?? null,
28
- pendingDecisionOrganizationUnitId: null,
29
- pendingDecisionAssigneeUserId: input.assigneeUserId ?? null,
30
- pendingDecisionClaimedAt: null,
31
- pendingDecisionRequesterKind: HumanDecision_RequesterKind.USER,
32
- pendingDecisionRequesterRef: requesterUserId,
33
- pendingDecisionRequesterClientId: null,
34
- pendingDecisionRequestedAt: new Date(Date.now() - 60_000),
35
- pendingDecisionExpiresAt: input.expiresAt ?? new Date(Date.now() + 60 * 60_000),
36
- pendingDecisionRouteVersion: input.routeVersion ?? 0,
37
- };
38
- }
39
- /**
40
- * An `ExecutionContextCreator` double whose requester re-check answers HOLDS with `requesterAuth` — the
41
- * authority the resumed tool must run under. Pass `lapsedReason` to make the requester's authority lapse.
42
- */
43
- export function requesterRebuildDouble(requesterAuth, lapsedReason) {
44
- return {
45
- rebuildDecisionRequesterAuthority: vi.fn(async (..._args) => (lapsedReason
46
- ? { standing: DecisionRequesterAuthorityStanding.LAPSED, reason: lapsedReason }
47
- : { standing: DecisionRequesterAuthorityStanding.HOLDS, auth: requesterAuth })),
48
- };
49
- }
50
- /** The six decision emitters, each a spy. */
51
- export function decisionAuditDouble() {
52
- return {
53
- logHumanDecisionRequested: vi.fn(async (..._args) => { }),
54
- logHumanDecisionResolved: vi.fn(async (..._args) => { }),
55
- logHumanDecisionReassigned: vi.fn(async (..._args) => { }),
56
- logHumanDecisionEscalated: vi.fn(async (..._args) => { }),
57
- logHumanDecisionClaimed: vi.fn(async (..._args) => { }),
58
- logHumanDecisionAnswerRefused: vi.fn(async (..._args) => { }),
59
- };
60
- }
61
- //# sourceMappingURL=pending-decision.fixtures.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pending-decision.fixtures.js","sourceRoot":"","sources":["../../../../../../src/flows-actors/services/__tests__/pending-decision.fixtures.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC5B,OAAO,EACL,mCAAmC,EACnC,kCAAkC,EAClC,kBAAkB,EAClB,2BAA2B,EAC3B,uBAAuB,GACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,kCAAkC,EAAE,MAAM,+EAA+E,CAAC;AAEnI,MAAM,CAAC,MAAM,YAAY,GAAG,sCAAsC,CAAC;AAEnE,mHAAmH;AACnH,MAAM,UAAU,iBAAiB,CAAC,KAajC;IACC,MAAM,eAAe,GAAG,KAAK,CAAC,eAAe,IAAI,KAAK,CAAC,WAAW,IAAI,IAAI,CAAC;IAC3E,OAAO;QACL,WAAW,EAAE,KAAK,CAAC,WAAW,IAAI,QAAQ;QAC1C,SAAS,EAAE,KAAK,CAAC,SAAS,IAAI,WAAW;QACzC,MAAM,EAAE,KAAK,CAAC,WAAW,IAAI,IAAI;QACjC,mBAAmB,EAAE,kCAAkC;QACvD,yBAAyB,EAAE,mCAAmC;QAC9D,MAAM,EAAE,kBAAkB,CAAC,iBAAiB;QAC5C,cAAc,EAAE,K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E,GAAG,KAAgB,EAAE,EAAE,GAAE,CAAC,CAAC;QACnE,wBAAwB,EAAE,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAgB,EAAE,EAAE,GAAE,CAAC,CAAC;QAClE,0BAA0B,EAAE,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAgB,EAAE,EAAE,GAAE,CAAC,CAAC;QACpE,yBAAyB,EAAE,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAgB,EAAE,EAAE,GAAE,CAAC,CAAC;QACnE,uBAAuB,EAAE,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAgB,EAAE,EAAE,GAAE,CAAC,CAAC;QACjE,6BAA6B,EAAE,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAgB,EAAE,EAAE,GAAE,CAAC,CAAC;KACxE,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Test doubles for a turn paused on a ROUTED decision (#1594), shared by every suite that answers one.\n *\n * A paused row carries its route and requester in columns, and the answer path reads them back from the\n * row — never from whoever answers. A fixture that omitted them would be a turn no door can answer, so\n * the doubles below build the whole shape once rather than letting each suite re-derive it.\n */\nimport { vi } from 'vitest';\nimport {\n FLOWS_ACTORS_DEFAULT_AGENT_INSTANCE,\n FLOWS_ACTORS_NO_MACHINE_CREDENTIAL,\n FlowsActors_Status,\n HumanDecision_RequesterKind,\n HumanDecision_RouteKind,\n} from '@wildo-ai/saas-models';\nimport { DecisionRequesterAuthorityStanding } from '~wildo-backend-lib/runtime/services/execution-context-creator.backend.service';\n\nexport const DECISION_REF = '6f1b0c55-5a3e-4d4b-9d38-0e7c1a2b3c4d';\n\n/** A row paused on a decision, with its route and requester stamped as `persistApprovalSuspension` writes them. */\nexport function pausedDecisionRow(input: {\n readonly blob: string;\n readonly executionId?: string;\n readonly systemRef?: string;\n readonly ownerUserId?: string;\n readonly requesterUserId?: string;\n readonly routeKind?: HumanDecision_RouteKind;\n readonly eligibleRole?: string;\n readonly organizationId?: string;\n readonly assigneeUserId?: string;\n readonly routeVersion?: number;\n readonly decisionRef?: string;\n readonly expiresAt?: Date;\n}): Record<string, unknown> {\n const requesterUserId = input.requesterUserId ?? input.ownerUserId ?? 'u1';\n return {\n executionId: input.executionId ?? 'exec-1',\n systemRef: input.systemRef ?? 'assistant',\n userId: input.ownerUserId ?? 'u1',\n machineCredentialId: FLOWS_ACTORS_NO_MACHINE_CREDENTIAL,\n resourceServerInstanceRef: FLOWS_ACTORS_DEFAULT_AGENT_INSTANCE,\n status: FlowsActors_Status.AWAITING_APPROVAL,\n pausedApproval: input.blob,\n messages: [],\n pendingDecisionRef: input.decisionRef ?? DECISION_REF,\n pendingDecisionRouteKind: input.routeKind ?? HumanDecision_RouteKind.OWNER,\n pendingDecisionEligibleRole: input.eligibleRole ?? null,\n pendingDecisionOrganizationId: input.organizationId ?? null,\n pendingDecisionOrganizationUnitId: null,\n pendingDecisionAssigneeUserId: input.assigneeUserId ?? null,\n pendingDecisionClaimedAt: null,\n pendingDecisionRequesterKind: HumanDecision_RequesterKind.USER,\n pendingDecisionRequesterRef: requesterUserId,\n pendingDecisionRequesterClientId: null,\n pendingDecisionRequestedAt: new Date(Date.now() - 60_000),\n pendingDecisionExpiresAt: input.expiresAt ?? new Date(Date.now() + 60 * 60_000),\n pendingDecisionRouteVersion: input.routeVersion ?? 0,\n };\n}\n\n/**\n * An `ExecutionContextCreator` double whose requester re-check answers HOLDS with `requesterAuth` — the\n * authority the resumed tool must run under. Pass `lapsedReason` to make the requester's authority lapse.\n */\nexport function requesterRebuildDouble(requesterAuth: unknown, lapsedReason?: string) {\n return {\n rebuildDecisionRequesterAuthority: vi.fn(async (..._args: unknown[]) => (lapsedReason\n ? { standing: DecisionRequesterAuthorityStanding.LAPSED, reason: lapsedReason }\n : { standing: DecisionRequesterAuthorityStanding.HOLDS, auth: requesterAuth })),\n };\n}\n\n/** The six decision emitters, each a spy. */\nexport function decisionAuditDouble() {\n return {\n logHumanDecisionRequested: vi.fn(async (..._args: unknown[]) => {}),\n logHumanDecisionResolved: vi.fn(async (..._args: unknown[]) => {}),\n logHumanDecisionReassigned: vi.fn(async (..._args: unknown[]) => {}),\n logHumanDecisionEscalated: vi.fn(async (..._args: unknown[]) => {}),\n logHumanDecisionClaimed: vi.fn(async (..._args: unknown[]) => {}),\n logHumanDecisionAnswerRefused: vi.fn(async (..._args: unknown[]) => {}),\n };\n}\n"]}
@@ -1,25 +0,0 @@
1
- type Row = Record<string, unknown>;
2
- export declare class InMemoryInfrastructureRepositories {
3
- private readonly uniqueFields;
4
- readonly tables: Map<string, Row[]>;
5
- /** Fields that must be unique per resource type (the declared `isUnique`). */
6
- constructor(uniqueFields?: Record<string, readonly string[]>);
7
- rows(resourceType: string): Row[];
8
- readUnscopedByKey<T = Row>(resourceType: string, filter: Record<string, unknown>): Promise<T | null>;
9
- insertDocumentForInfrastructure<T = Row>(resourceType: string, document: Row): Promise<T>;
10
- atomicGuardedMutation<T = Row>(resourceType: string, filter: Record<string, unknown>, mutation: {
11
- set?: Row;
12
- clear?: readonly string[];
13
- increment?: Record<string, number>;
14
- }): Promise<T | null>;
15
- deleteManyForInfrastructure(resourceType: string, filter: Record<string, unknown>): Promise<number>;
16
- findManyForInfrastructure<T = Row>(resourceType: string, filter: Record<string, unknown>, _executionContext?: unknown, _options?: unknown, bounds?: {
17
- sort: readonly {
18
- field: string;
19
- order: string;
20
- }[];
21
- limit: number;
22
- }): Promise<T[]>;
23
- }
24
- export {};
25
- //# sourceMappingURL=in-memory-infrastructure-repositories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"in-memory-infrastructure-repositories.d.ts","sourceRoot":"","sources":["../../../../../../../src/inbound/services/__tests__/support/in-memory-infrastructure-repositories.ts"],"names":[],"mappings":"AAWA,KAAK,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAiBnC,qBAAa,kCAAkC;IAGjC,OAAO,CAAC,QAAQ,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QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAC5E,OAAO,CAAC,CAAC,EAAE,CAAC;CAehB"}
@@ -1,92 +0,0 @@
1
- /**
2
- * An in-memory stand-in for the INFRASTRUCTURE-tier repository doors the inbound channel services use
3
- * (`readUnscopedByKey`, `insertDocumentForInfrastructure`, `atomicGuardedMutation`,
4
- * `findManyForInfrastructure`, `deleteManyForInfrastructure`) — equality, `null`, `$in`, `$lt`, `$lte` filters, a compare-and-swap that
5
- * matches or does nothing, and a CONFLICT on a duplicate `_id` or declared unique field.
6
- *
7
- * Deliberately small: it models the semantics the services rely on, not an adapter. The store's own
8
- * adapter parity is pinned by #1596's integration tests on MongoDB and PostgreSQL.
9
- */
10
- import { ErrorType } from '@wildo-ai/saas-models';
11
- function matches(row, filter) {
12
- return Object.entries(filter).every(([field, expected]) => {
13
- const actual = row[field];
14
- if (expected !== null && typeof expected === 'object' && !(expected instanceof Date) && !Array.isArray(expected)) {
15
- const operators = expected;
16
- if ('$in' in operators)
17
- return operators.$in.includes(actual);
18
- if ('$lt' in operators)
19
- return actual instanceof Date && actual.getTime() < operators.$lt.getTime();
20
- if ('$lte' in operators)
21
- return actual instanceof Date && actual.getTime() <= operators.$lte.getTime();
22
- }
23
- if (expected === null)
24
- return actual === null || actual === undefined;
25
- if (expected instanceof Date)
26
- return actual instanceof Date && actual.getTime() === expected.getTime();
27
- return actual === expected;
28
- });
29
- }
30
- export class InMemoryInfrastructureRepositories {
31
- uniqueFields;
32
- tables = new Map();
33
- /** Fields that must be unique per resource type (the declared `isUnique`). */
34
- constructor(uniqueFields = {}) {
35
- this.uniqueFields = uniqueFields;
36
- }
37
- rows(resourceType) {
38
- if (!this.tables.has(resourceType))
39
- this.tables.set(resourceType, []);
40
- return this.tables.get(resourceType);
41
- }
42
- async readUnscopedByKey(resourceType, filter) {
43
- return this.rows(resourceType).find((row) => matches(row, filter)) ?? null;
44
- }
45
- async insertDocumentForInfrastructure(resourceType, document) {
46
- const rows = this.rows(resourceType);
47
- const unique = ['_id', ...(this.uniqueFields[resourceType] ?? [])];
48
- for (const field of unique) {
49
- if (document[field] !== undefined && document[field] !== null && rows.some((row) => row[field] === document[field])) {
50
- throw Object.assign(new Error(`duplicate ${field}`), { type: ErrorType.CONFLICT, statusCode: 409, severity: 'medium', customMessageReference: 'conflict' });
51
- }
52
- }
53
- const stored = structuredClone(document);
54
- rows.push(stored);
55
- return structuredClone(stored);
56
- }
57
- async atomicGuardedMutation(resourceType, filter, mutation) {
58
- const row = this.rows(resourceType).find((candidate) => matches(candidate, filter));
59
- if (!row)
60
- return null;
61
- Object.assign(row, structuredClone(mutation.set ?? {}));
62
- for (const field of mutation.clear ?? [])
63
- delete row[field];
64
- for (const [field, delta] of Object.entries(mutation.increment ?? {}))
65
- row[field] = (row[field] ?? 0) + delta;
66
- return structuredClone(row);
67
- }
68
- async deleteManyForInfrastructure(resourceType, filter) {
69
- const rows = this.rows(resourceType);
70
- const kept = rows.filter((row) => !matches(row, filter));
71
- const removed = rows.length - kept.length;
72
- this.tables.set(resourceType, kept);
73
- return removed;
74
- }
75
- async findManyForInfrastructure(resourceType, filter, _executionContext, _options, bounds) {
76
- let found = this.rows(resourceType).filter((row) => matches(row, filter));
77
- if (bounds) {
78
- found = [...found].sort((a, b) => {
79
- for (const { field, order } of bounds.sort) {
80
- const left = a[field] instanceof Date ? a[field].getTime() : a[field];
81
- const right = b[field] instanceof Date ? b[field].getTime() : b[field];
82
- if (left === right)
83
- continue;
84
- return (left < right ? -1 : 1) * (String(order).toLowerCase() === 'desc' ? -1 : 1);
85
- }
86
- return 0;
87
- }).slice(0, bounds.limit);
88
- }
89
- return structuredClone(found);
90
- }
91
- }
92
- //# sourceMappingURL=in-memory-infrastructure-repositories.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"in-memory-infrastructure-repositories.js","sourceRoot":"","sources":["../../../../../../../src/inbound/services/__tests__/support/in-memory-infrastructure-repositories.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG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AAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACrF,CAAC;gBACD,OAAO,CAAC,CAAC;YACX,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;QAC5B,CAAC;QACD,OAAO,eAAe,CAAC,KAAK,CAAQ,CAAC;IACvC,CAAC;CACF","sourcesContent":["/**\n * An in-memory stand-in for the INFRASTRUCTURE-tier repository doors the inbound channel services use\n * (`readUnscopedByKey`, `insertDocumentForInfrastructure`, `atomicGuardedMutation`,\n * `findManyForInfrastructure`, `deleteManyForInfrastructure`) — equality, `null`, `$in`, `$lt`, `$lte` filters, a compare-and-swap that\n * matches or does nothing, and a CONFLICT on a duplicate `_id` or declared unique field.\n *\n * Deliberately small: it models the semantics the services rely on, not an adapter. The store's own\n * adapter parity is pinned by #1596's integration tests on MongoDB and PostgreSQL.\n */\nimport { ErrorType } from '@wildo-ai/saas-models';\n\ntype Row = Record<string, unknown>;\n\nfunction matches(row: Row, filter: Record<string, unknown>): boolean {\n return Object.entries(filter).every(([field, expected]) => {\n const actual = row[field];\n if (expected !== null && typeof expected === 'object' && !(expected instanceof Date) && !Array.isArray(expected)) {\n const operators = expected as Record<string, unknown>;\n if ('$in' in operators) return (operators.$in as unknown[]).includes(actual);\n if ('$lt' in operators) return actual instanceof Date && actual.getTime() < (operators.$lt as Date).getTime();\n if ('$lte' in operators) return actual instanceof Date && actual.getTime() <= (operators.$lte as Date).getTime();\n }\n if (expected === null) return actual === null || actual === undefined;\n if (expected instanceof Date) return actual instanceof Date && actual.getTime() === expected.getTime();\n return actual === expected;\n });\n}\n\nexport class InMemoryInfrastructureRepositories {\n readonly tables = new Map<string, Row[]>();\n /** Fields that must be unique per resource type (the declared `isUnique`). */\n constructor(private readonly uniqueFields: Record<string, readonly string[]> = {}) {}\n\n rows(resourceType: string): Row[] {\n if (!this.tables.has(resourceType)) this.tables.set(resourceType, []);\n return this.tables.get(resourceType)!;\n }\n\n async readUnscopedByKey<T = Row>(resourceType: string, filter: Record<string, unknown>): Promise<T | null> {\n return (this.rows(resourceType).find((row) => matches(row, filter)) as T | undefined) ?? null;\n }\n\n async insertDocumentForInfrastructure<T = Row>(resourceType: string, document: Row): Promise<T> {\n const rows = this.rows(resourceType);\n const unique = ['_id', ...(this.uniqueFields[resourceType] ?? [])];\n for (const field of unique) {\n if (document[field] !== undefined && document[field] !== null && rows.some((row) => row[field] === document[field])) {\n throw Object.assign(new Error(`duplicate ${field}`), { type: ErrorType.CONFLICT, statusCode: 409, severity: 'medium', customMessageReference: 'conflict' });\n }\n }\n const stored = structuredClone(document);\n rows.push(stored);\n return structuredClone(stored) as T;\n }\n\n async atomicGuardedMutation<T = Row>(resourceType: string, filter: Record<string, unknown>, mutation: { set?: Row; clear?: readonly string[]; increment?: Record<string, number> }): Promise<T | null> {\n const row = this.rows(resourceType).find((candidate) => matches(candidate, filter));\n if (!row) return null;\n Object.assign(row, structuredClone(mutation.set ?? {}));\n for (const field of mutation.clear ?? []) delete row[field];\n for (const [field, delta] of Object.entries(mutation.increment ?? {})) row[field] = ((row[field] as number) ?? 0) + delta;\n return structuredClone(row) as T;\n }\n\n async deleteManyForInfrastructure(resourceType: string, filter: Record<string, unknown>): Promise<number> {\n const rows = this.rows(resourceType);\n const kept = rows.filter((row) => !matches(row, filter));\n const removed = rows.length - kept.length;\n this.tables.set(resourceType, kept);\n return removed;\n }\n\n async findManyForInfrastructure<T = Row>(\n resourceType: string,\n filter: Record<string, unknown>,\n _executionContext?: unknown,\n _options?: unknown,\n bounds?: { sort: readonly { field: string; order: string }[]; limit: number },\n ): Promise<T[]> {\n let found = this.rows(resourceType).filter((row) => matches(row, filter));\n if (bounds) {\n found = [...found].sort((a, b) => {\n for (const { field, order } of bounds.sort) {\n const left = a[field] instanceof Date ? (a[field] as Date).getTime() : (a[field] as never);\n const right = b[field] instanceof Date ? (b[field] as Date).getTime() : (b[field] as never);\n if (left === right) continue;\n return (left < right ? -1 : 1) * (String(order).toLowerCase() === 'desc' ? -1 : 1);\n }\n return 0;\n }).slice(0, bounds.limit);\n }\n return structuredClone(found) as T[];\n }\n}\n"]}
@@ -1,7 +0,0 @@
1
- import { type MetaWorkflow_EvaluationTreatmentDefinition } from '@wildo-ai/saas-models/meta-workflows';
2
- export interface MetaWorkflowEvaluationTreatmentTestFixture {
3
- definition: MetaWorkflow_EvaluationTreatmentDefinition;
4
- bytes: Uint8Array;
5
- }
6
- export declare function createMetaWorkflowEvaluationTreatmentTestFixture(suffix?: string, conditional?: boolean): MetaWorkflowEvaluationTreatmentTestFixture;
7
- //# sourceMappingURL=meta-workflow-evaluation-treatment.test-fixture.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"meta-workflow-evaluation-treatment.test-fixture.d.ts","sourceRoot":"","sources":["../../../../../../../src/meta-workflows/services/__tests__/fixtures/meta-workflow-evaluation-treatment.test-fixture.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,0CAA0C,EAChD,MAAM,sCAAsC,CAAC;AAS9C,MAAM,WAAW,0CAA0C;IACzD,UAAU,EAAE,0CAA0C,CAAC;IACvD,KAAK,EAAE,UAAU,CAAC;CACnB;AAED,wBAAgB,gDAAgD,CAC9D,MAAM,SAAY,EAClB,WAAW,UAAQ,GAClB,0CAA0C,CAiM5C"}
@@ -1,194 +0,0 @@
1
- import { MetaWorkflow_ContinuationAction, MetaWorkflow_DecisionConsequence, MetaWorkflow_DecisionRuleBoundaryClass, MetaWorkflow_EvaluationAggregationStrategy, MetaWorkflow_EvaluationPromptAssemblyStrategy, MetaWorkflow_EvaluationVerdict, MetaWorkflow_EvidenceRequirementKind, } from '@wildo-ai/saas-models/meta-workflows';
2
- import { canonicalizeJson, } from '../../../../flows-actors/utils/canonical-json.backend.utils.js';
3
- const encoder = new TextEncoder();
4
- const DIGEST = `sha256:${'a'.repeat(64)}`;
5
- export function createMetaWorkflowEvaluationTreatmentTestFixture(suffix = 'default', conditional = false) {
6
- const requirementInput = {
7
- schemaVersion: 1,
8
- requirementRef: `meta-workflow:evidence-requirement/${suffix}`,
9
- requirementVersion: 1,
10
- kind: conditional
11
- ? MetaWorkflow_EvidenceRequirementKind.CONDITIONAL
12
- : MetaWorkflow_EvidenceRequirementKind.MANDATORY,
13
- criterionRef: `meta-workflow:criterion/${suffix}`,
14
- subjectRef: `meta-workflow:subject/${suffix}`,
15
- minCount: 1,
16
- maxCount: 1,
17
- coveragePolicyRef: `meta-workflow:policy/coverage/${suffix}`,
18
- freshnessPolicyRef: `meta-workflow:policy/freshness/${suffix}`,
19
- conditionRef: conditional
20
- ? `meta-workflow:condition/${suffix}`
21
- : null,
22
- independencePolicyRef: null,
23
- diversityPolicyRef: null,
24
- aggregationPolicyRef: null,
25
- };
26
- const requirement = {
27
- ...requirementInput,
28
- };
29
- const criterionInput = {
30
- schemaVersion: 1,
31
- criterionRef: requirement.criterionRef,
32
- criterionVersion: 1,
33
- instruction: `Assess the ${suffix} criterion from the exact sealed evidence.`,
34
- evidenceRequirements: [{
35
- requirementRef: requirement.requirementRef,
36
- requirementVersion: requirement.requirementVersion,
37
- }],
38
- verdictGuidance: {
39
- [MetaWorkflow_EvaluationVerdict.PASS]: 'The criterion is fully supported by the sealed evidence.',
40
- [MetaWorkflow_EvaluationVerdict.CONCERN]: 'The criterion is supported with a material but non-blocking concern.',
41
- [MetaWorkflow_EvaluationVerdict.GAP]: 'The sealed evidence demonstrates a material criterion gap.',
42
- [MetaWorkflow_EvaluationVerdict.INDETERMINATE]: 'The sealed evidence is insufficient or conflicting.',
43
- },
44
- };
45
- const criterion = {
46
- ...criterionInput,
47
- };
48
- const aggregationPolicyRef = `meta-workflow:aggregation/${suffix}`;
49
- const protocolInput = {
50
- schemaVersion: 1,
51
- protocolRef: `meta-workflow:evaluation-protocol/${suffix}`,
52
- protocolVersion: 1,
53
- criteria: [criterion],
54
- promptAssemblyStrategy: MetaWorkflow_EvaluationPromptAssemblyStrategy.CANONICAL_PROTOCOL_EVIDENCE_V1,
55
- aggregationStrategy: MetaWorkflow_EvaluationAggregationStrategy.WORST_VERDICT_PRECEDENCE_V1,
56
- verdictPrecedence: [
57
- MetaWorkflow_EvaluationVerdict.GAP,
58
- MetaWorkflow_EvaluationVerdict.INDETERMINATE,
59
- MetaWorkflow_EvaluationVerdict.CONCERN,
60
- MetaWorkflow_EvaluationVerdict.PASS,
61
- ],
62
- aggregationPolicyRef,
63
- provenance: {
64
- sourcePlaybookRef: `meta-workflow:playbook/${suffix}`,
65
- compilerRef: 'meta-workflow:compiler/evaluation-treatment',
66
- compilerVersion: 1,
67
- },
68
- };
69
- const evaluationProtocol = {
70
- ...protocolInput,
71
- };
72
- const evaluatorPolicyInput = {
73
- schemaVersion: 1,
74
- policyRef: `meta-workflow:evaluator-binding-policy/${suffix}`,
75
- policyVersion: 1,
76
- admissibleEvaluatorDescriptors: [{
77
- descriptorRef: `meta-workflow:evaluator/${suffix}`,
78
- descriptorVersion: 1,
79
- }],
80
- defaultEvaluatorDescriptor: {
81
- descriptorRef: `meta-workflow:evaluator/${suffix}`,
82
- descriptorVersion: 1,
83
- },
84
- fallbackPolicyRef: `meta-workflow:policy/fallback/${suffix}`,
85
- escalationPolicyRef: `meta-workflow:policy/escalation/${suffix}`,
86
- maximumAttempts: 1,
87
- timeoutPolicyRef: `meta-workflow:policy/timeout/${suffix}`,
88
- budgetPolicyRef: `meta-workflow:policy/budget/${suffix}`,
89
- outputSchemaRef: `meta-workflow:schema/evaluation/${suffix}`,
90
- selectionPolicyRef: `meta-workflow:policy/selection/${suffix}`,
91
- };
92
- const evaluatorBindingPolicy = {
93
- ...evaluatorPolicyInput,
94
- };
95
- const decisionRuleInput = {
96
- schemaVersion: 1,
97
- ruleRef: `meta-workflow:decision-rule/${suffix}`,
98
- ruleVersion: 1,
99
- boundaryClass: MetaWorkflow_DecisionRuleBoundaryClass.QUALITY_INTERPRETATION,
100
- evidenceAggregationRef: aggregationPolicyRef,
101
- resultMappings: [
102
- {
103
- verdict: MetaWorkflow_EvaluationVerdict.PASS,
104
- consequence: MetaWorkflow_DecisionConsequence.CONTINUE,
105
- },
106
- {
107
- verdict: MetaWorkflow_EvaluationVerdict.INDETERMINATE,
108
- consequence: MetaWorkflow_DecisionConsequence.REQUEST_EVIDENCE,
109
- },
110
- ],
111
- hardFloorBindings: [],
112
- hardFloorFailureConsequence: MetaWorkflow_DecisionConsequence.BLOCK,
113
- hardFloorShortcutAllowed: false,
114
- unresolvedConsequence: MetaWorkflow_DecisionConsequence.REQUEST_EVIDENCE,
115
- evaluatorFailureConsequence: MetaWorkflow_DecisionConsequence.BLOCK,
116
- };
117
- const decisionRule = {
118
- ...decisionRuleInput,
119
- };
120
- const continuationInput = {
121
- schemaVersion: 1,
122
- policyRef: `meta-workflow:continuation-policy/${suffix}`,
123
- policyVersion: 1,
124
- mappings: [
125
- {
126
- decisionConsequence: MetaWorkflow_DecisionConsequence.CONTINUE,
127
- action: MetaWorkflow_ContinuationAction.CONTINUE,
128
- },
129
- {
130
- decisionConsequence: MetaWorkflow_DecisionConsequence.REQUEST_EVIDENCE,
131
- action: MetaWorkflow_ContinuationAction.REQUEST_EVIDENCE,
132
- },
133
- {
134
- decisionConsequence: MetaWorkflow_DecisionConsequence.BLOCK,
135
- action: MetaWorkflow_ContinuationAction.BLOCK,
136
- },
137
- ],
138
- maximumRevisionAttempts: 1,
139
- maximumEvidenceRequests: 1,
140
- maximumAuthorityReviews: 0,
141
- fallbackAction: MetaWorkflow_ContinuationAction.BLOCK,
142
- };
143
- const continuationPolicy = {
144
- ...continuationInput,
145
- };
146
- const decisionPointInput = {
147
- schemaVersion: 1,
148
- decisionPointRef: `meta-workflow:decision-point/${suffix}`,
149
- decisionPointVersion: 1,
150
- triggerRefs: [],
151
- evidenceRequirements: [{
152
- requirementRef: requirement.requirementRef,
153
- requirementVersion: requirement.requirementVersion,
154
- }],
155
- evaluatorBindingPolicy: {
156
- policyRef: evaluatorBindingPolicy.policyRef,
157
- policyVersion: evaluatorBindingPolicy.policyVersion,
158
- },
159
- decisionRule: {
160
- ruleRef: decisionRule.ruleRef,
161
- ruleVersion: decisionRule.ruleVersion,
162
- },
163
- authorityRequirement: null,
164
- continuationPolicy: {
165
- policyRef: continuationPolicy.policyRef,
166
- policyVersion: continuationPolicy.policyVersion,
167
- },
168
- hardFloorRefs: [],
169
- riskPolicyRef: `meta-workflow:policy/risk/${suffix}`,
170
- significancePolicyRef: `meta-workflow:policy/significance/${suffix}`,
171
- };
172
- const decisionPointDefinition = {
173
- ...decisionPointInput,
174
- };
175
- const definitionInput = {
176
- schemaVersion: 1,
177
- definitionRef: `meta-workflow:evaluation-treatment/${suffix}`,
178
- definitionVersion: 1,
179
- evaluationProtocol,
180
- evidenceRequirements: [requirement],
181
- evaluatorBindingPolicy,
182
- decisionPointDefinition,
183
- decisionRule,
184
- authorityRequirement: null,
185
- continuationPolicy,
186
- };
187
- const definition = definitionInput;
188
- const bytes = encoder.encode(canonicalizeJson(definition));
189
- return {
190
- definition,
191
- bytes,
192
- };
193
- }
194
- //# sourceMappingURL=meta-workflow-evaluation-treatment.test-fixture.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"meta-workflow-evaluation-treatment.test-fixture.js","sourceRoot":"","sources":["../../../../../../../src/meta-workflows/services/__tests__/fixtures/meta-workflow-evaluation-treatment.test-fixture.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,+BAA+B,EAC/B,gCAAgC,EAChC,sCAAsC,EACtC,0CAA0C,EAC1C,6CAA6C,EAC7C,8BAA8B,EAC9B,oCAAoC,GAGrC,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EACL,gBAAgB,GACjB,MAAM,6DAA6D,CAAC;AAErE,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;AAClC,MAAM,MAAM,GAAG,UAAU,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;AAO1C,MAAM,UAAU,gDAAgD,CAC9D,MAAM,GAAG,SAAS,EAClB,WAAW,GAAG,KAAK;IAEnB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CAAC;AACJ,CAAC","sourcesContent":["import {\n MetaWorkflow_ContinuationAction,\n MetaWorkflow_DecisionConsequence,\n MetaWorkflow_DecisionRuleBoundaryClass,\n MetaWorkflow_EvaluationAggregationStrategy,\n MetaWorkflow_EvaluationPromptAssemblyStrategy,\n MetaWorkflow_EvaluationVerdict,\n MetaWorkflow_EvidenceRequirementKind,\n MetaWorkflow_ExecutionDefinitionSchemaRef,\n type MetaWorkflow_EvaluationTreatmentDefinition,\n} from '@wildo-ai/saas-models/meta-workflows';\n\nimport {\n canonicalizeJson,\n} from '../../../../flows-actors/utils/canonical-json.backend.utils';\n\nconst encoder = new TextEncoder();\nconst DIGEST = `sha256:${'a'.repeat(64)}`;\n\nexport interface MetaWorkflowEvaluationTreatmentTestFixture {\n definition: MetaWorkflow_EvaluationTreatmentDefinition;\n bytes: Uint8Array;\n}\n\nexport function createMetaWorkflowEvaluationTreatmentTestFixture(\n suffix = 'default',\n conditional = false,\n): MetaWorkflowEvaluationTreatmentTestFixture {\n const requirementInput = {\n schemaVersion: 1 as const,\n requirementRef: `meta-workflow:evidence-requirement/${suffix}`,\n requirementVersion: 1,\n kind: conditional\n ? MetaWorkflow_EvidenceRequirementKind.CONDITIONAL\n : MetaWorkflow_EvidenceRequirementKind.MANDATORY,\n criterionRef: `meta-workflow:criterion/${suffix}`,\n subjectRef: `meta-workflow:subject/${suffix}`,\n minCount: 1,\n maxCount: 1,\n coveragePolicyRef: `meta-workflow:policy/coverage/${suffix}`,\n freshnessPolicyRef: `meta-workflow:policy/freshness/${suffix}`,\n conditionRef: conditional\n ? `meta-workflow:condition/${suffix}`\n : null,\n independencePolicyRef: null,\n diversityPolicyRef: null,\n aggregationPolicyRef: null,\n };\n const requirement = {\n ...requirementInput,\n };\n const criterionInput = {\n schemaVersion: 1 as const,\n criterionRef: requirement.criterionRef,\n criterionVersion: 1,\n instruction: `Assess the ${suffix} criterion from the exact sealed evidence.`,\n evidenceRequirements: [{\n requirementRef: requirement.requirementRef,\n requirementVersion: requirement.requirementVersion,\n }],\n verdictGuidance: {\n [MetaWorkflow_EvaluationVerdict.PASS]: 'The criterion is fully supported by the sealed evidence.',\n [MetaWorkflow_EvaluationVerdict.CONCERN]: 'The criterion is supported with a material but non-blocking concern.',\n [MetaWorkflow_EvaluationVerdict.GAP]: 'The sealed evidence demonstrates a material criterion gap.',\n [MetaWorkflow_EvaluationVerdict.INDETERMINATE]: 'The sealed evidence is insufficient or conflicting.',\n },\n };\n const criterion = {\n ...criterionInput,\n };\n const aggregationPolicyRef = `meta-workflow:aggregation/${suffix}`;\n const protocolInput = {\n schemaVersion: 1 as const,\n protocolRef: `meta-workflow:evaluation-protocol/${suffix}`,\n protocolVersion: 1,\n criteria: [criterion],\n promptAssemblyStrategy: MetaWorkflow_EvaluationPromptAssemblyStrategy.CANONICAL_PROTOCOL_EVIDENCE_V1,\n aggregationStrategy: MetaWorkflow_EvaluationAggregationStrategy.WORST_VERDICT_PRECEDENCE_V1,\n verdictPrecedence: [\n MetaWorkflow_EvaluationVerdict.GAP,\n MetaWorkflow_EvaluationVerdict.INDETERMINATE,\n MetaWorkflow_EvaluationVerdict.CONCERN,\n MetaWorkflow_EvaluationVerdict.PASS,\n ] as [\n MetaWorkflow_EvaluationVerdict.GAP,\n MetaWorkflow_EvaluationVerdict.INDETERMINATE,\n MetaWorkflow_EvaluationVerdict.CONCERN,\n MetaWorkflow_EvaluationVerdict.PASS,\n ],\n aggregationPolicyRef,\n provenance: {\n sourcePlaybookRef: `meta-workflow:playbook/${suffix}`,\n compilerRef: 'meta-workflow:compiler/evaluation-treatment',\n compilerVersion: 1,\n },\n };\n const evaluationProtocol = {\n ...protocolInput,\n };\n const evaluatorPolicyInput = {\n schemaVersion: 1 as const,\n policyRef: `meta-workflow:evaluator-binding-policy/${suffix}`,\n policyVersion: 1,\n admissibleEvaluatorDescriptors: [{\n descriptorRef: `meta-workflow:evaluator/${suffix}`,\n descriptorVersion: 1,\n }],\n defaultEvaluatorDescriptor: {\n descriptorRef: `meta-workflow:evaluator/${suffix}`,\n descriptorVersion: 1,\n },\n fallbackPolicyRef: `meta-workflow:policy/fallback/${suffix}`,\n escalationPolicyRef: `meta-workflow:policy/escalation/${suffix}`,\n maximumAttempts: 1,\n timeoutPolicyRef: `meta-workflow:policy/timeout/${suffix}`,\n budgetPolicyRef: `meta-workflow:policy/budget/${suffix}`,\n outputSchemaRef: `meta-workflow:schema/evaluation/${suffix}`,\n selectionPolicyRef: `meta-workflow:policy/selection/${suffix}`,\n };\n const evaluatorBindingPolicy = {\n ...evaluatorPolicyInput,\n };\n const decisionRuleInput = {\n schemaVersion: 1 as const,\n ruleRef: `meta-workflow:decision-rule/${suffix}`,\n ruleVersion: 1,\n boundaryClass: MetaWorkflow_DecisionRuleBoundaryClass.QUALITY_INTERPRETATION,\n evidenceAggregationRef: aggregationPolicyRef,\n resultMappings: [\n {\n verdict: MetaWorkflow_EvaluationVerdict.PASS,\n consequence: MetaWorkflow_DecisionConsequence.CONTINUE,\n },\n {\n verdict: MetaWorkflow_EvaluationVerdict.INDETERMINATE,\n consequence: MetaWorkflow_DecisionConsequence.REQUEST_EVIDENCE,\n },\n ],\n hardFloorBindings: [],\n hardFloorFailureConsequence: MetaWorkflow_DecisionConsequence.BLOCK as const,\n hardFloorShortcutAllowed: false as const,\n unresolvedConsequence: MetaWorkflow_DecisionConsequence.REQUEST_EVIDENCE,\n evaluatorFailureConsequence: MetaWorkflow_DecisionConsequence.BLOCK,\n };\n const decisionRule = {\n ...decisionRuleInput,\n };\n const continuationInput = {\n schemaVersion: 1 as const,\n policyRef: `meta-workflow:continuation-policy/${suffix}`,\n policyVersion: 1,\n mappings: [\n {\n decisionConsequence: MetaWorkflow_DecisionConsequence.CONTINUE,\n action: MetaWorkflow_ContinuationAction.CONTINUE,\n },\n {\n decisionConsequence: MetaWorkflow_DecisionConsequence.REQUEST_EVIDENCE,\n action: MetaWorkflow_ContinuationAction.REQUEST_EVIDENCE,\n },\n {\n decisionConsequence: MetaWorkflow_DecisionConsequence.BLOCK,\n action: MetaWorkflow_ContinuationAction.BLOCK,\n },\n ],\n maximumRevisionAttempts: 1,\n maximumEvidenceRequests: 1,\n maximumAuthorityReviews: 0,\n fallbackAction: MetaWorkflow_ContinuationAction.BLOCK as const,\n };\n const continuationPolicy = {\n ...continuationInput,\n };\n const decisionPointInput = {\n schemaVersion: 1 as const,\n decisionPointRef: `meta-workflow:decision-point/${suffix}`,\n decisionPointVersion: 1,\n triggerRefs: [],\n evidenceRequirements: [{\n requirementRef: requirement.requirementRef,\n requirementVersion: requirement.requirementVersion,\n }],\n evaluatorBindingPolicy: {\n policyRef: evaluatorBindingPolicy.policyRef,\n policyVersion: evaluatorBindingPolicy.policyVersion,\n },\n decisionRule: {\n ruleRef: decisionRule.ruleRef,\n ruleVersion: decisionRule.ruleVersion,\n },\n authorityRequirement: null,\n continuationPolicy: {\n policyRef: continuationPolicy.policyRef,\n policyVersion: continuationPolicy.policyVersion,\n },\n hardFloorRefs: [],\n riskPolicyRef: `meta-workflow:policy/risk/${suffix}`,\n significancePolicyRef: `meta-workflow:policy/significance/${suffix}`,\n };\n const decisionPointDefinition = {\n ...decisionPointInput,\n };\n const definitionInput = {\n schemaVersion: 1 as const,\n definitionRef: `meta-workflow:evaluation-treatment/${suffix}`,\n definitionVersion: 1,\n evaluationProtocol,\n evidenceRequirements: [requirement],\n evaluatorBindingPolicy,\n decisionPointDefinition,\n decisionRule,\n authorityRequirement: null,\n continuationPolicy,\n };\n const definition: MetaWorkflow_EvaluationTreatmentDefinition = definitionInput;\n const bytes = encoder.encode(canonicalizeJson(definition));\n return {\n definition,\n bytes,\n };\n}\n"]}
@@ -1,34 +0,0 @@
1
- /**
2
- * Vitest-oriented mock logger for integration tests (`vi.fn` on methods).
3
- *
4
- * **Naming**: `mock-*.service.ts` — canonical mock module, not a test suite.
5
- * Plain `.ts` keeps it barrel-compilable, and Vitest also excludes these files
6
- * explicitly as a defensive guard.
7
- */
8
- import 'reflect-metadata';
9
- import type { LoggerService } from '../logger.service';
10
- declare class MockLoggerServiceImpl {
11
- private debugTypes;
12
- info: import("vitest").Mock<any[], void>;
13
- warn: import("vitest").Mock<any[], void>;
14
- error: import("vitest").Mock<any[], void>;
15
- debug: import("vitest").Mock<any[], void>;
16
- trace: import("vitest").Mock<any[], void>;
17
- fatal: import("vitest").Mock<any[], void>;
18
- child: import("vitest").Mock<[], MockLoggerServiceImpl>;
19
- debugByType: import("vitest").Mock<[type: string], (message: string, context?: Record<string, unknown>) => void>;
20
- setDebugTypeLogging: import("vitest").Mock<[type: string, enabled: boolean], void>;
21
- reset(): void;
22
- }
23
- /**
24
- * Re-typed constructor — same reason as the error-builder doubles: the production class this is
25
- * handed to declares `private` members, which TypeScript matches by DECLARATION SITE, so a
26
- * structural double can never be assignable to it. The intersection preserves the mock surface
27
- * (`.mock.calls` and friends) that a plain assertion would erase.
28
- */
29
- export declare const MockLoggerService: {
30
- new (...args: ConstructorParameters<typeof MockLoggerServiceImpl>): LoggerService & MockLoggerServiceImpl;
31
- };
32
- export type MockLoggerService = LoggerService & MockLoggerServiceImpl;
33
- export {};
34
- //# sourceMappingURL=mock-logger.service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mock-logger.service.d.ts","sourceRoot":"","sources":["../../../../../../../src/monitoring/logger/services/__tests__/mock-logger.service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,kBAAkB,CAAC;AAG1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,cACM,qBAAqB;IACzB,OAAO,CAAC,UAAU,CAAmC;IAErD,IAAI,qCAAkC;IACtC,IAAI,qCAAkC;IACtC,KAAK,qCAAkC;IACvC,KAAK,qCAAkC;IACvC,KAAK,qCAAkC;IACvC,KAAK,qCAAkC;IAEvC,KAAK,mDAA4C;IAEjD,WAAW,kDACQ,MAAM,YAAY,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,WAKzD;IAEH,mBAAmB,gEAEhB;IAEH,KAAK;CAYN;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAuC;IACnE,KAAK,GAAG,IAAI,EAAE,qBAAqB,CAAC,OAAO,qBAAqB,CAAC,GAAG,aAAa,GAAG,qBAAqB,CAAC;CAC3G,CAAC;AACF,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG,qBAAqB,CAAC"}