declastruct 1.0.0 → 1.1.1

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 (250) hide show
  1. package/dist/.test/assets/providers/demo.provider.d.ts +32 -0
  2. package/dist/.test/assets/providers/demo.provider.js +101 -0
  3. package/dist/.test/assets/providers/demo.provider.js.map +1 -0
  4. package/dist/contract/cli/apply.d.ts +9 -0
  5. package/dist/contract/cli/apply.integration.test.js +148 -0
  6. package/dist/contract/cli/apply.integration.test.js.map +1 -0
  7. package/dist/contract/cli/apply.js +90 -0
  8. package/dist/contract/cli/apply.js.map +1 -0
  9. package/dist/contract/cli/invoke.d.ts +8 -0
  10. package/dist/contract/cli/invoke.js +58 -0
  11. package/dist/contract/cli/invoke.js.map +1 -0
  12. package/dist/contract/cli/plan.d.ts +10 -0
  13. package/dist/contract/cli/plan.integration.test.js +107 -0
  14. package/dist/contract/cli/plan.integration.test.js.map +1 -0
  15. package/dist/contract/cli/plan.js +94 -0
  16. package/dist/contract/cli/plan.js.map +1 -0
  17. package/dist/contract/sdk/index.d.ts +15 -3
  18. package/dist/contract/sdk/index.js +31 -17
  19. package/dist/contract/sdk/index.js.map +1 -1
  20. package/dist/domain.objects/ContextDeclastruct.d.ts +15 -0
  21. package/dist/{domain/DeclastructContext.js → domain.objects/ContextDeclastruct.js} +1 -1
  22. package/dist/domain.objects/ContextDeclastruct.js.map +1 -0
  23. package/dist/domain.objects/ContextDeclastruct.test.js +41 -0
  24. package/dist/domain.objects/ContextDeclastruct.test.js.map +1 -0
  25. package/dist/domain.objects/DeclastructChange.d.ts +73 -0
  26. package/dist/domain.objects/DeclastructChange.js +35 -0
  27. package/dist/domain.objects/DeclastructChange.js.map +1 -0
  28. package/dist/domain.objects/DeclastructChange.test.js +59 -0
  29. package/dist/domain.objects/DeclastructChange.test.js.map +1 -0
  30. package/dist/domain.objects/DeclastructDao.d.ts +39 -0
  31. package/dist/domain.objects/DeclastructDao.js +8 -0
  32. package/dist/domain.objects/DeclastructDao.js.map +1 -0
  33. package/dist/domain.objects/DeclastructDao.test.js +42 -0
  34. package/dist/domain.objects/DeclastructDao.test.js.map +1 -0
  35. package/dist/domain.objects/DeclastructPlan.d.ts +35 -0
  36. package/dist/domain.objects/DeclastructPlan.js +11 -0
  37. package/dist/domain.objects/DeclastructPlan.js.map +1 -0
  38. package/dist/domain.objects/DeclastructPlan.test.js +31 -0
  39. package/dist/domain.objects/DeclastructPlan.test.js.map +1 -0
  40. package/dist/domain.objects/DeclastructProvider.d.ts +30 -0
  41. package/dist/domain.objects/DeclastructProvider.js +8 -0
  42. package/dist/domain.objects/DeclastructProvider.js.map +1 -0
  43. package/dist/domain.objects/DeclastructProvider.test.js +35 -0
  44. package/dist/domain.objects/DeclastructProvider.test.js.map +1 -0
  45. package/dist/domain.objects/IsoTimestamp.d.ts +6 -0
  46. package/dist/{domain/DeclaredResource.js → domain.objects/IsoTimestamp.js} +1 -1
  47. package/dist/domain.objects/IsoTimestamp.js.map +1 -0
  48. package/dist/domain.objects/IsoTimestamp.test.js +10 -0
  49. package/dist/domain.objects/IsoTimestamp.test.js.map +1 -0
  50. package/dist/domain.operations/apply/applyChange.d.ts +14 -0
  51. package/dist/domain.operations/apply/applyChange.js +64 -0
  52. package/dist/domain.operations/apply/applyChange.js.map +1 -0
  53. package/dist/domain.operations/apply/applyChange.test.d.ts +1 -0
  54. package/dist/domain.operations/apply/applyChange.test.js +247 -0
  55. package/dist/domain.operations/apply/applyChange.test.js.map +1 -0
  56. package/dist/domain.operations/apply/applyChanges.d.ts +18 -0
  57. package/dist/domain.operations/apply/applyChanges.integration.test.d.ts +1 -0
  58. package/dist/domain.operations/apply/applyChanges.integration.test.js +291 -0
  59. package/dist/domain.operations/apply/applyChanges.integration.test.js.map +1 -0
  60. package/dist/domain.operations/apply/applyChanges.js +53 -0
  61. package/dist/domain.operations/apply/applyChanges.js.map +1 -0
  62. package/dist/domain.operations/plan/computeChange.d.ts +11 -0
  63. package/dist/domain.operations/plan/computeChange.js +78 -0
  64. package/dist/domain.operations/plan/computeChange.js.map +1 -0
  65. package/dist/domain.operations/plan/computeChange.test.d.ts +1 -0
  66. package/dist/domain.operations/plan/computeChange.test.js +67 -0
  67. package/dist/domain.operations/plan/computeChange.test.js.map +1 -0
  68. package/dist/domain.operations/plan/extractResourcesFromPlan.d.ts +8 -0
  69. package/dist/domain.operations/plan/extractResourcesFromPlan.js +17 -0
  70. package/dist/domain.operations/plan/extractResourcesFromPlan.js.map +1 -0
  71. package/dist/domain.operations/plan/getDaoByResource.d.ts +12 -0
  72. package/dist/domain.operations/plan/getDaoByResource.js +41 -0
  73. package/dist/domain.operations/plan/getDaoByResource.js.map +1 -0
  74. package/dist/domain.operations/plan/getDaoByResource.test.d.ts +1 -0
  75. package/dist/domain.operations/plan/getDaoByResource.test.js +99 -0
  76. package/dist/domain.operations/plan/getDaoByResource.test.js.map +1 -0
  77. package/dist/domain.operations/plan/hashChanges.d.ts +7 -0
  78. package/dist/domain.operations/plan/hashChanges.js +18 -0
  79. package/dist/domain.operations/plan/hashChanges.js.map +1 -0
  80. package/dist/domain.operations/plan/planChanges.d.ts +15 -0
  81. package/dist/domain.operations/plan/planChanges.integration.test.d.ts +1 -0
  82. package/dist/domain.operations/plan/planChanges.integration.test.js +197 -0
  83. package/dist/domain.operations/plan/planChanges.integration.test.js.map +1 -0
  84. package/dist/domain.operations/plan/planChanges.js +50 -0
  85. package/dist/domain.operations/plan/planChanges.js.map +1 -0
  86. package/dist/domain.operations/plan/validate.d.ts +10 -0
  87. package/dist/domain.operations/plan/validate.js +21 -0
  88. package/dist/domain.operations/plan/validate.js.map +1 -0
  89. package/dist/infra/asIsoTimestamp.d.ts +6 -0
  90. package/dist/infra/asIsoTimestamp.js +12 -0
  91. package/dist/infra/asIsoTimestamp.js.map +1 -0
  92. package/package.json +8 -15
  93. package/readme.md +225 -29
  94. package/dist/__test_assets__/getExampleContext.d.ts +0 -33
  95. package/dist/__test_assets__/getExampleContext.js +0 -87
  96. package/dist/__test_assets__/getExampleContext.js.map +0 -1
  97. package/dist/contract/commands/command.apply.d.ts +0 -6
  98. package/dist/contract/commands/command.apply.js +0 -20
  99. package/dist/contract/commands/command.apply.js.map +0 -1
  100. package/dist/contract/commands/command.plan.d.ts +0 -6
  101. package/dist/contract/commands/command.plan.js +0 -20
  102. package/dist/contract/commands/command.plan.js.map +0 -1
  103. package/dist/contract/commands/utils/resolveCommandInputs.d.ts +0 -17
  104. package/dist/contract/commands/utils/resolveCommandInputs.js +0 -23
  105. package/dist/contract/commands/utils/resolveCommandInputs.js.map +0 -1
  106. package/dist/contract/sdk/refs.d.ts +0 -2
  107. package/dist/contract/sdk/refs.js +0 -19
  108. package/dist/contract/sdk/refs.js.map +0 -1
  109. package/dist/contract/sdk/sync/apply.d.ts +0 -22
  110. package/dist/contract/sdk/sync/apply.js +0 -29
  111. package/dist/contract/sdk/sync/apply.js.map +0 -1
  112. package/dist/contract/sdk/sync/plan.d.ts +0 -22
  113. package/dist/contract/sdk/sync/plan.js +0 -30
  114. package/dist/contract/sdk/sync/plan.js.map +0 -1
  115. package/dist/domain/DeclaredResource.d.ts +0 -2
  116. package/dist/domain/DeclaredResource.js.map +0 -1
  117. package/dist/domain/DeclaredResourceReference.d.ts +0 -66
  118. package/dist/domain/DeclaredResourceReference.js +0 -42
  119. package/dist/domain/DeclaredResourceReference.js.map +0 -1
  120. package/dist/domain/DeclastructChangeProposal.d.ts +0 -61
  121. package/dist/domain/DeclastructChangeProposal.js +0 -37
  122. package/dist/domain/DeclastructChangeProposal.js.map +0 -1
  123. package/dist/domain/DeclastructContext.d.ts +0 -24
  124. package/dist/domain/DeclastructContext.js.map +0 -1
  125. package/dist/domain/DeclastructProvider.d.ts +0 -58
  126. package/dist/domain/DeclastructProvider.js +0 -3
  127. package/dist/domain/DeclastructProvider.js.map +0 -1
  128. package/dist/domain/DeclastructProviderContext.d.ts +0 -30
  129. package/dist/domain/DeclastructProviderContext.js +0 -3
  130. package/dist/domain/DeclastructProviderContext.js.map +0 -1
  131. package/dist/domain/DeclastructProviderResourceRemoteStateInterface.d.ts +0 -156
  132. package/dist/domain/DeclastructProviderResourceRemoteStateInterface.js +0 -3
  133. package/dist/domain/DeclastructProviderResourceRemoteStateInterface.js.map +0 -1
  134. package/dist/logic/actions/execute/canUpdateResource.d.ts +0 -5
  135. package/dist/logic/actions/execute/canUpdateResource.js +0 -12
  136. package/dist/logic/actions/execute/canUpdateResource.js.map +0 -1
  137. package/dist/logic/actions/execute/executeProposal.d.ts +0 -5
  138. package/dist/logic/actions/execute/executeProposal.js +0 -52
  139. package/dist/logic/actions/execute/executeProposal.js.map +0 -1
  140. package/dist/logic/actions/propose/getColoredActionToken.d.ts +0 -4
  141. package/dist/logic/actions/propose/getColoredActionToken.js +0 -22
  142. package/dist/logic/actions/propose/getColoredActionToken.js.map +0 -1
  143. package/dist/logic/actions/propose/getColoredProposalTitle.d.ts +0 -4
  144. package/dist/logic/actions/propose/getColoredProposalTitle.js +0 -34
  145. package/dist/logic/actions/propose/getColoredProposalTitle.js.map +0 -1
  146. package/dist/logic/actions/propose/proposeChangeForResource.d.ts +0 -7
  147. package/dist/logic/actions/propose/proposeChangeForResource.js +0 -65
  148. package/dist/logic/actions/propose/proposeChangeForResource.js.map +0 -1
  149. package/dist/logic/actions/propose/proposeChangeForResource.test.js +0 -48
  150. package/dist/logic/actions/propose/proposeChangeForResource.test.js.map +0 -1
  151. package/dist/logic/commands/command.apply.d.ts +0 -8
  152. package/dist/logic/commands/command.apply.js +0 -77
  153. package/dist/logic/commands/command.apply.js.map +0 -1
  154. package/dist/logic/commands/command.plan.d.ts +0 -13
  155. package/dist/logic/commands/command.plan.js +0 -155
  156. package/dist/logic/commands/command.plan.js.map +0 -1
  157. package/dist/logic/commands/execute.d.ts +0 -15
  158. package/dist/logic/commands/execute.js +0 -63
  159. package/dist/logic/commands/execute.js.map +0 -1
  160. package/dist/logic/tools/compare/castReferenceToGrokableString.d.ts +0 -16
  161. package/dist/logic/tools/compare/castReferenceToGrokableString.js +0 -66
  162. package/dist/logic/tools/compare/castReferenceToGrokableString.js.map +0 -1
  163. package/dist/logic/tools/compare/castReferenceToGrokableString.test.js +0 -111
  164. package/dist/logic/tools/compare/castReferenceToGrokableString.test.js.map +0 -1
  165. package/dist/logic/tools/compare/detectDifferenceBetweenDesiredAndRemoteStateOfResource.d.ts +0 -11
  166. package/dist/logic/tools/compare/detectDifferenceBetweenDesiredAndRemoteStateOfResource.js +0 -61
  167. package/dist/logic/tools/compare/detectDifferenceBetweenDesiredAndRemoteStateOfResource.js.map +0 -1
  168. package/dist/logic/tools/compare/detectDifferenceBetweenDesiredAndRemoteStateOfResource.test.js +0 -31
  169. package/dist/logic/tools/compare/detectDifferenceBetweenDesiredAndRemoteStateOfResource.test.js.map +0 -1
  170. package/dist/logic/tools/compare/resolveReferenceToCommonComparableForm.d.ts +0 -21
  171. package/dist/logic/tools/compare/resolveReferenceToCommonComparableForm.js +0 -53
  172. package/dist/logic/tools/compare/resolveReferenceToCommonComparableForm.js.map +0 -1
  173. package/dist/logic/tools/compare/resolveReferenceToCommonComparableForm.test.js +0 -31
  174. package/dist/logic/tools/compare/resolveReferenceToCommonComparableForm.test.js.map +0 -1
  175. package/dist/logic/tools/compare/resolveReferencesToCommonComparableForm.d.ts +0 -10
  176. package/dist/logic/tools/compare/resolveReferencesToCommonComparableForm.js +0 -41
  177. package/dist/logic/tools/compare/resolveReferencesToCommonComparableForm.js.map +0 -1
  178. package/dist/logic/tools/compare/resolveReferencesToCommonComparableForm.test.js +0 -174
  179. package/dist/logic/tools/compare/resolveReferencesToCommonComparableForm.test.js.map +0 -1
  180. package/dist/logic/tools/context/createDeclastructContext.d.ts +0 -10
  181. package/dist/logic/tools/context/createDeclastructContext.js +0 -12
  182. package/dist/logic/tools/context/createDeclastructContext.js.map +0 -1
  183. package/dist/logic/tools/context/destroyDeclastructContext.d.ts +0 -4
  184. package/dist/logic/tools/context/destroyDeclastructContext.js +0 -10
  185. package/dist/logic/tools/context/destroyDeclastructContext.js.map +0 -1
  186. package/dist/logic/tools/provider/castProviderContextToGlobalContext.d.ts +0 -4
  187. package/dist/logic/tools/provider/castProviderContextToGlobalContext.js +0 -10
  188. package/dist/logic/tools/provider/castProviderContextToGlobalContext.js.map +0 -1
  189. package/dist/logic/tools/provider/getProviderContextFromGlobalContextForResourceClass.d.ts +0 -13
  190. package/dist/logic/tools/provider/getProviderContextFromGlobalContextForResourceClass.js +0 -29
  191. package/dist/logic/tools/provider/getProviderContextFromGlobalContextForResourceClass.js.map +0 -1
  192. package/dist/logic/tools/provider/getProviderResourceRemoteStateInterfaceExecutionDependenciesForResource.d.ts +0 -13
  193. package/dist/logic/tools/provider/getProviderResourceRemoteStateInterfaceExecutionDependenciesForResource.js +0 -24
  194. package/dist/logic/tools/provider/getProviderResourceRemoteStateInterfaceExecutionDependenciesForResource.js.map +0 -1
  195. package/dist/logic/tools/provider/getProviderResourceRemoteStateInterfaceFromContextForResourceClass.d.ts +0 -10
  196. package/dist/logic/tools/provider/getProviderResourceRemoteStateInterfaceFromContextForResourceClass.js +0 -21
  197. package/dist/logic/tools/provider/getProviderResourceRemoteStateInterfaceFromContextForResourceClass.js.map +0 -1
  198. package/dist/logic/tools/reference/buildPrimaryKeyTo.d.ts +0 -5
  199. package/dist/logic/tools/reference/buildPrimaryKeyTo.js +0 -40
  200. package/dist/logic/tools/reference/buildPrimaryKeyTo.js.map +0 -1
  201. package/dist/logic/tools/reference/buildReferenceTo.d.ts +0 -28
  202. package/dist/logic/tools/reference/buildReferenceTo.js +0 -92
  203. package/dist/logic/tools/reference/buildReferenceTo.js.map +0 -1
  204. package/dist/logic/tools/reference/buildReferenceTo.test.js +0 -119
  205. package/dist/logic/tools/reference/buildReferenceTo.test.js.map +0 -1
  206. package/dist/logic/tools/reference/buildUniqueKeyTo.d.ts +0 -5
  207. package/dist/logic/tools/reference/buildUniqueKeyTo.js +0 -40
  208. package/dist/logic/tools/reference/buildUniqueKeyTo.js.map +0 -1
  209. package/dist/logic/tools/reference/defineReferenceClassOf.d.ts +0 -5
  210. package/dist/logic/tools/reference/defineReferenceClassOf.js +0 -25
  211. package/dist/logic/tools/reference/defineReferenceClassOf.js.map +0 -1
  212. package/dist/logic/tools/reference/defineReferenceKeyConstituentsOf.d.ts +0 -13
  213. package/dist/logic/tools/reference/defineReferenceKeyConstituentsOf.js +0 -36
  214. package/dist/logic/tools/reference/defineReferenceKeyConstituentsOf.js.map +0 -1
  215. package/dist/logic/tools/reference/getByReference.d.ts +0 -15
  216. package/dist/logic/tools/reference/getByReference.js +0 -55
  217. package/dist/logic/tools/reference/getByReference.js.map +0 -1
  218. package/dist/logic/tools/reference/getByReference.test.js +0 -92
  219. package/dist/logic/tools/reference/getByReference.test.js.map +0 -1
  220. package/dist/logic/tools/reference/getByReferencedPrimaryKey.d.ts +0 -6
  221. package/dist/logic/tools/reference/getByReferencedPrimaryKey.js +0 -17
  222. package/dist/logic/tools/reference/getByReferencedPrimaryKey.js.map +0 -1
  223. package/dist/logic/tools/reference/getByReferencedUniqueKey.d.ts +0 -7
  224. package/dist/logic/tools/reference/getByReferencedUniqueKey.js +0 -42
  225. package/dist/logic/tools/reference/getByReferencedUniqueKey.js.map +0 -1
  226. package/dist/logic/tools/reference/getPrimaryKeyByReference.d.ts +0 -15
  227. package/dist/logic/tools/reference/getPrimaryKeyByReference.js +0 -36
  228. package/dist/logic/tools/reference/getPrimaryKeyByReference.js.map +0 -1
  229. package/dist/logic/tools/reference/getReferenceTo.d.ts +0 -18
  230. package/dist/logic/tools/reference/getReferenceTo.js +0 -55
  231. package/dist/logic/tools/reference/getReferenceTo.js.map +0 -1
  232. package/dist/logic/tools/reference/getReferenceTo.test.js +0 -95
  233. package/dist/logic/tools/reference/getReferenceTo.test.js.map +0 -1
  234. package/dist/logic/tools/reference/getUniqueKeyByReference.d.ts +0 -15
  235. package/dist/logic/tools/reference/getUniqueKeyByReference.js +0 -36
  236. package/dist/logic/tools/reference/getUniqueKeyByReference.js.map +0 -1
  237. package/dist/logic/tools/reference/isPrimaryKeyReference.d.ts +0 -6
  238. package/dist/logic/tools/reference/isPrimaryKeyReference.js +0 -7
  239. package/dist/logic/tools/reference/isPrimaryKeyReference.js.map +0 -1
  240. package/dist/logic/tools/reference/isUniqueKeyReference.d.ts +0 -6
  241. package/dist/logic/tools/reference/isUniqueKeyReference.js +0 -7
  242. package/dist/logic/tools/reference/isUniqueKeyReference.js.map +0 -1
  243. /package/dist/{logic/actions/propose/proposeChangeForResource.test.d.ts → contract/cli/apply.integration.test.d.ts} +0 -0
  244. /package/dist/{logic/tools/compare/castReferenceToGrokableString.test.d.ts → contract/cli/plan.integration.test.d.ts} +0 -0
  245. /package/dist/{logic/tools/compare/detectDifferenceBetweenDesiredAndRemoteStateOfResource.test.d.ts → domain.objects/ContextDeclastruct.test.d.ts} +0 -0
  246. /package/dist/{logic/tools/compare/resolveReferenceToCommonComparableForm.test.d.ts → domain.objects/DeclastructChange.test.d.ts} +0 -0
  247. /package/dist/{logic/tools/compare/resolveReferencesToCommonComparableForm.test.d.ts → domain.objects/DeclastructDao.test.d.ts} +0 -0
  248. /package/dist/{logic/tools/reference/buildReferenceTo.test.d.ts → domain.objects/DeclastructPlan.test.d.ts} +0 -0
  249. /package/dist/{logic/tools/reference/getByReference.test.d.ts → domain.objects/DeclastructProvider.test.d.ts} +0 -0
  250. /package/dist/{logic/tools/reference/getReferenceTo.test.d.ts → domain.objects/IsoTimestamp.test.d.ts} +0 -0
@@ -0,0 +1,30 @@
1
+ import { DomainLiteral } from 'domain-objects';
2
+ import { DeclastructDao } from './DeclastructDao';
3
+ export type DeclastructDaosShape<TContext> = Record<string, DeclastructDao<any, any, TContext>>;
4
+ /**
5
+ * .what = bundles all DAOs and lifecycle hooks for a specific infrastructure provider
6
+ * .why = enables plug-and-play support for different infrastructure backends (AWS, GCP, Azure, etc)
7
+ */
8
+ export interface DeclastructProvider<TDeclastructDaos extends DeclastructDaosShape<TContext> = DeclastructDaosShape<any>, TContext = any> {
9
+ /**
10
+ * unique name identifying this provider
11
+ */
12
+ name: string;
13
+ /**
14
+ * map of resource class names to their DAOs
15
+ */
16
+ daos: TDeclastructDaos;
17
+ /**
18
+ * provider-specific context (credentials, region, etc)
19
+ */
20
+ context: TContext;
21
+ /**
22
+ * lifecycle hooks for setup and teardown
23
+ */
24
+ hooks: {
25
+ beforeAll: () => Promise<void>;
26
+ afterAll: () => Promise<void>;
27
+ };
28
+ }
29
+ export declare class DeclastructProvider<TDeclastructDaos extends DeclastructDaosShape<TContext> = DeclastructDaosShape<any>, TContext = any> extends DomainLiteral<DeclastructProvider<TDeclastructDaos, TContext>> implements DeclastructProvider<TDeclastructDaos, TContext> {
30
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeclastructProvider = void 0;
4
+ const domain_objects_1 = require("domain-objects");
5
+ class DeclastructProvider extends domain_objects_1.DomainLiteral {
6
+ }
7
+ exports.DeclastructProvider = DeclastructProvider;
8
+ //# sourceMappingURL=DeclastructProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeclastructProvider.js","sourceRoot":"","sources":["../../src/domain.objects/DeclastructProvider.ts"],"names":[],"mappings":";;;AAAA,mDAA+C;AAyC/C,MAAa,mBAIX,SAAQ,8BAA8D;CACT;AAL/D,kDAK+D"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const DeclastructProvider_1 = require("./DeclastructProvider");
4
+ describe('DeclastructProvider', () => {
5
+ it('should build a provider with all required properties', () => {
6
+ const provider = new DeclastructProvider_1.DeclastructProvider({
7
+ name: 'test-provider',
8
+ daos: {},
9
+ context: {},
10
+ hooks: {
11
+ beforeAll: async () => { },
12
+ afterAll: async () => { },
13
+ },
14
+ });
15
+ expect(provider.name).toBe('test-provider');
16
+ expect(provider.daos).toEqual({});
17
+ expect(provider.context).toEqual({});
18
+ expect(provider.hooks.beforeAll).toBeDefined();
19
+ expect(provider.hooks.afterAll).toBeDefined();
20
+ });
21
+ it('should work without explicit type arguments', () => {
22
+ // type verification - default type parameters should work
23
+ const provider = new DeclastructProvider_1.DeclastructProvider({
24
+ name: 'default-provider',
25
+ daos: {},
26
+ context: {},
27
+ hooks: {
28
+ beforeAll: async () => { },
29
+ afterAll: async () => { },
30
+ },
31
+ });
32
+ expect(provider).toBeDefined();
33
+ });
34
+ });
35
+ //# sourceMappingURL=DeclastructProvider.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeclastructProvider.test.js","sourceRoot":"","sources":["../../src/domain.objects/DeclastructProvider.test.ts"],"names":[],"mappings":";;AAAA,+DAA4D;AAE5D,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACnC,EAAE,CAAC,sDAAsD,EAAE,GAAG,EAAE;QAC9D,MAAM,QAAQ,GAAG,IAAI,yCAAmB,CAAC;YACvC,IAAI,EAAE,eAAe;YACrB,IAAI,EAAE,EAAE;YACR,OAAO,EAAE,EAAE;YACX,KAAK,EAAE;gBACL,SAAS,EAAE,KAAK,IAAI,EAAE,GAAE,CAAC;gBACzB,QAAQ,EAAE,KAAK,IAAI,EAAE,GAAE,CAAC;aACzB;SACF,CAAC,CAAC;QAEH,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAC5C,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAClC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACrC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,CAAC;QAC/C,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC;IAChD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE;QACrD,0DAA0D;QAC1D,MAAM,QAAQ,GAAG,IAAI,yCAAmB,CAAC;YACvC,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE,EAAE;YACR,OAAO,EAAE,EAAE;YACX,KAAK,EAAE;gBACL,SAAS,EAAE,KAAK,IAAI,EAAE,GAAE,CAAC;gBACzB,QAAQ,EAAE,KAAK,IAAI,EAAE,GAAE,CAAC;aACzB;SACF,CAAC,CAAC;QAEH,MAAM,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC;IACjC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * .what = ISO 8601 timestamp string type
3
+ * .why = provides type safety for timestamp strings while maintaining JSON serialization compatibility
4
+ * .note = represents timestamps in ISO 8601 format (e.g., "2025-11-22T10:30:00.000Z")
5
+ */
6
+ export type IsoTimestamp = string;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=DeclaredResource.js.map
3
+ //# sourceMappingURL=IsoTimestamp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IsoTimestamp.js","sourceRoot":"","sources":["../../src/domain.objects/IsoTimestamp.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ describe('IsoTimestamp', () => {
4
+ it('should be a string type', () => {
5
+ // type verification
6
+ const timestamp = '2025-11-22T10:30:00.000Z';
7
+ expect(typeof timestamp).toBe('string');
8
+ });
9
+ });
10
+ //# sourceMappingURL=IsoTimestamp.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IsoTimestamp.test.js","sourceRoot":"","sources":["../../src/domain.objects/IsoTimestamp.test.ts"],"names":[],"mappings":";;AAEA,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,EAAE,CAAC,yBAAyB,EAAE,GAAG,EAAE;QACjC,oBAAoB;QACpB,MAAM,SAAS,GAAiB,0BAA0B,CAAC;QAC3D,MAAM,CAAC,OAAO,SAAS,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { DomainEntity } from 'domain-objects';
2
+ import { DeclastructChange } from '../../domain.objects/DeclastructChange';
3
+ import { DeclastructProvider } from '../../domain.objects/DeclastructProvider';
4
+ /**
5
+ * .what = applies a single change to infrastructure
6
+ * .why = executes the actual infrastructure modification
7
+ * .note = different actions require different DAO methods; fails fast if method not available
8
+ */
9
+ export declare const applyChange: <TContext = any>({ resource, change, providers, context, }: {
10
+ resource: DomainEntity<any>;
11
+ change: DeclastructChange;
12
+ providers: DeclastructProvider<any, TContext>[];
13
+ context: TContext;
14
+ }) => Promise<DeclastructChange>;
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.applyChange = void 0;
4
+ const helpful_errors_1 = require("helpful-errors");
5
+ const DeclastructChange_1 = require("../../domain.objects/DeclastructChange");
6
+ const getDaoByResource_1 = require("../plan/getDaoByResource");
7
+ /**
8
+ * .what = applies a single change to infrastructure
9
+ * .why = executes the actual infrastructure modification
10
+ * .note = different actions require different DAO methods; fails fast if method not available
11
+ */
12
+ const applyChange = async ({ resource, change, providers, context, }) => {
13
+ // skip KEEP actions immediately
14
+ if (change.action === DeclastructChange_1.DeclastructChangeAction.KEEP)
15
+ return change;
16
+ // validate that the name of the resource and on the change is the same
17
+ if (resource.constructor.name !== change.forResource.class)
18
+ throw new helpful_errors_1.UnexpectedCodePathError('why were we asked to apply a change on an unrelated resource?', { resource, change });
19
+ const dao = (0, getDaoByResource_1.getDaoByResource)({
20
+ resource,
21
+ providers,
22
+ });
23
+ // execute action based on change type
24
+ switch (change.action) {
25
+ case DeclastructChange_1.DeclastructChangeAction.CREATE:
26
+ // create new resource
27
+ await dao.set.finsert(change.state.desired, context);
28
+ return change;
29
+ case DeclastructChange_1.DeclastructChangeAction.UPDATE:
30
+ // update existing resource
31
+ if (!dao.set.upsert) {
32
+ throw new helpful_errors_1.UnexpectedCodePathError('DAO does not support updates', {
33
+ resourceClassName: change.forResource.class,
34
+ });
35
+ }
36
+ await dao.set.upsert(change.state.desired, context);
37
+ return change;
38
+ case DeclastructChange_1.DeclastructChangeAction.DESTROY:
39
+ // delete resource
40
+ if (!dao.set.delete) {
41
+ throw new helpful_errors_1.UnexpectedCodePathError('DAO does not support deletes', {
42
+ resourceClassName: change.forResource.class,
43
+ });
44
+ }
45
+ await dao.set.delete(change.state.remote, context);
46
+ return change;
47
+ case DeclastructChange_1.DeclastructChangeAction.REPLACE:
48
+ // delete then create
49
+ if (!dao.set.delete) {
50
+ throw new helpful_errors_1.UnexpectedCodePathError('DAO does not support deletes', {
51
+ resourceClassName: change.forResource.class,
52
+ });
53
+ }
54
+ await dao.set.delete(change.state.remote, context);
55
+ await dao.set.finsert(change.state.desired, context);
56
+ return change;
57
+ default:
58
+ throw new helpful_errors_1.UnexpectedCodePathError('unknown change action', {
59
+ action: change.action,
60
+ });
61
+ }
62
+ };
63
+ exports.applyChange = applyChange;
64
+ //# sourceMappingURL=applyChange.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"applyChange.js","sourceRoot":"","sources":["../../../src/domain.operations/apply/applyChange.ts"],"names":[],"mappings":";;;AACA,mDAAyD;AAEzD,8EAGgD;AAEhD,+DAA4D;AAE5D;;;;GAIG;AACI,MAAM,WAAW,GAAG,KAAK,EAAkB,EAChD,QAAQ,EACR,MAAM,EACN,SAAS,EACT,OAAO,GAMR,EAA8B,EAAE;IAC/B,gCAAgC;IAChC,IAAI,MAAM,CAAC,MAAM,KAAK,2CAAuB,CAAC,IAAI;QAAE,OAAO,MAAM,CAAC;IAElE,uEAAuE;IACvE,IAAI,QAAQ,CAAC,WAAW,CAAC,IAA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YACrB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;gBACpB,MAAM,IAAI,wCAAuB,CAAC,8BAA8B,EAAE;oBAChE,iBAAiB,EAAE,MAAM,CAAC,WAAW,CAAC,KAAK;iBAC5C,CAAC,CAAC;YACL,CAAC;YACD,MAAM,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,MAAa,EAAE,OAAO,CAAC,CAAC;YAC1D,MAAM,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAQ,EAAE,OAAO,CAAC,CAAC;YACtD,OAAO,MAAM,CAAC;QAEhB;YACE,MAAM,IAAI,wCAAuB,CAAC,uBAAuB,EAAE;gBACzD,MAAM,EAAE,MAAM,CAAC,MAAM;aACtB,CAAC,CAAC;IACP,CAAC;AACH,CAAC,CAAC;AArEW,QAAA,WAAW,eAqEtB"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,247 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const domain_objects_1 = require("domain-objects");
4
+ const helpful_errors_1 = require("helpful-errors");
5
+ const DeclastructChange_1 = require("../../domain.objects/DeclastructChange");
6
+ const DeclastructProvider_1 = require("../../domain.objects/DeclastructProvider");
7
+ const applyChange_1 = require("./applyChange");
8
+ describe('applyChange', () => {
9
+ class DemoResource extends domain_objects_1.DomainEntity {
10
+ }
11
+ DemoResource.unique = ['id'];
12
+ it('should return immediately for KEEP action without calling DAO', async () => {
13
+ const resource = new DemoResource({ id: 'keep-1', name: 'Keep Me' });
14
+ const change = new DeclastructChange_1.DeclastructChange({
15
+ forResource: {
16
+ class: DemoResource.name,
17
+ slug: 'keep-1',
18
+ },
19
+ action: DeclastructChange_1.DeclastructChangeAction.KEEP,
20
+ state: {
21
+ desired: resource,
22
+ remote: resource,
23
+ difference: null,
24
+ },
25
+ });
26
+ const result = await (0, applyChange_1.applyChange)({
27
+ resource,
28
+ change,
29
+ providers: [],
30
+ context: {},
31
+ });
32
+ expect(result).toBe(change);
33
+ });
34
+ it('should call finsert for CREATE action', async () => {
35
+ const resource = new DemoResource({ id: 'create-1', name: 'Create Me' });
36
+ const finsertSpy = jest.fn().mockResolvedValue(resource);
37
+ const dao = {
38
+ get: {
39
+ byUnique: async () => null,
40
+ byRef: async () => null,
41
+ },
42
+ set: {
43
+ finsert: finsertSpy,
44
+ },
45
+ };
46
+ const provider = new DeclastructProvider_1.DeclastructProvider({
47
+ name: 'test-provider',
48
+ daos: { DemoResource: dao },
49
+ context: {},
50
+ hooks: {
51
+ beforeAll: async () => { },
52
+ afterAll: async () => { },
53
+ },
54
+ });
55
+ const change = new DeclastructChange_1.DeclastructChange({
56
+ forResource: {
57
+ class: DemoResource.name,
58
+ slug: 'create-1',
59
+ },
60
+ action: DeclastructChange_1.DeclastructChangeAction.CREATE,
61
+ state: {
62
+ desired: resource,
63
+ remote: null,
64
+ difference: 'some diff',
65
+ },
66
+ });
67
+ await (0, applyChange_1.applyChange)({
68
+ resource,
69
+ change,
70
+ providers: [provider],
71
+ context: {},
72
+ });
73
+ expect(finsertSpy).toHaveBeenCalledWith(resource, {});
74
+ });
75
+ it('should call upsert for UPDATE action', async () => {
76
+ const remote = new DemoResource({ id: 'update-1', name: 'Old Name' });
77
+ const desired = new DemoResource({ id: 'update-1', name: 'New Name' });
78
+ const upsertSpy = jest.fn().mockResolvedValue(desired);
79
+ const dao = {
80
+ get: {
81
+ byUnique: async () => null,
82
+ byRef: async () => null,
83
+ },
84
+ set: {
85
+ finsert: async (input) => input,
86
+ upsert: upsertSpy,
87
+ },
88
+ };
89
+ const provider = new DeclastructProvider_1.DeclastructProvider({
90
+ name: 'test-provider',
91
+ daos: { DemoResource: dao },
92
+ context: {},
93
+ hooks: {
94
+ beforeAll: async () => { },
95
+ afterAll: async () => { },
96
+ },
97
+ });
98
+ const change = new DeclastructChange_1.DeclastructChange({
99
+ forResource: {
100
+ class: DemoResource.name,
101
+ slug: 'update-1',
102
+ },
103
+ action: DeclastructChange_1.DeclastructChangeAction.UPDATE,
104
+ state: {
105
+ desired,
106
+ remote,
107
+ difference: 'some diff',
108
+ },
109
+ });
110
+ await (0, applyChange_1.applyChange)({
111
+ resource: desired,
112
+ change,
113
+ providers: [provider],
114
+ context: {},
115
+ });
116
+ expect(upsertSpy).toHaveBeenCalledWith(desired, {});
117
+ });
118
+ it('should throw when UPDATE action but DAO does not support upsert', async () => {
119
+ const remote = new DemoResource({ id: 'update-1', name: 'Old Name' });
120
+ const desired = new DemoResource({ id: 'update-1', name: 'New Name' });
121
+ const dao = {
122
+ get: {
123
+ byUnique: async () => null,
124
+ byRef: async () => null,
125
+ },
126
+ set: {
127
+ finsert: async (input) => input,
128
+ },
129
+ };
130
+ const provider = new DeclastructProvider_1.DeclastructProvider({
131
+ name: 'test-provider',
132
+ daos: { DemoResource: dao },
133
+ context: {},
134
+ hooks: {
135
+ beforeAll: async () => { },
136
+ afterAll: async () => { },
137
+ },
138
+ });
139
+ const change = new DeclastructChange_1.DeclastructChange({
140
+ forResource: {
141
+ class: DemoResource.name,
142
+ slug: 'update-1',
143
+ },
144
+ action: DeclastructChange_1.DeclastructChangeAction.UPDATE,
145
+ state: {
146
+ desired,
147
+ remote,
148
+ difference: 'some diff',
149
+ },
150
+ });
151
+ const error = await (0, helpful_errors_1.getError)(() => (0, applyChange_1.applyChange)({
152
+ resource: desired,
153
+ change,
154
+ providers: [provider],
155
+ context: {},
156
+ }));
157
+ expect(error.message).toContain('DAO does not support updates');
158
+ });
159
+ it('should call delete for DESTROY action', async () => {
160
+ const resource = new DemoResource({ id: 'destroy-1', name: 'Delete Me' });
161
+ const deleteSpy = jest.fn().mockResolvedValue(undefined);
162
+ const dao = {
163
+ get: {
164
+ byUnique: async () => null,
165
+ byRef: async () => null,
166
+ },
167
+ set: {
168
+ finsert: async (input) => input,
169
+ delete: deleteSpy,
170
+ },
171
+ };
172
+ const provider = new DeclastructProvider_1.DeclastructProvider({
173
+ name: 'test-provider',
174
+ daos: { DemoResource: dao },
175
+ context: {},
176
+ hooks: {
177
+ beforeAll: async () => { },
178
+ afterAll: async () => { },
179
+ },
180
+ });
181
+ const change = new DeclastructChange_1.DeclastructChange({
182
+ forResource: {
183
+ class: DemoResource.name,
184
+ slug: 'destroy-1',
185
+ },
186
+ action: DeclastructChange_1.DeclastructChangeAction.DESTROY,
187
+ state: {
188
+ desired: null,
189
+ remote: resource,
190
+ difference: 'some diff',
191
+ },
192
+ });
193
+ await (0, applyChange_1.applyChange)({
194
+ resource,
195
+ change,
196
+ providers: [provider],
197
+ context: {},
198
+ });
199
+ expect(deleteSpy).toHaveBeenCalledWith(resource, {});
200
+ });
201
+ it('should call delete then finsert for REPLACE action', async () => {
202
+ const remote = new DemoResource({ id: 'replace-1', name: 'Old' });
203
+ const desired = new DemoResource({ id: 'replace-2', name: 'New' });
204
+ const deleteSpy = jest.fn().mockResolvedValue(undefined);
205
+ const finsertSpy = jest.fn().mockResolvedValue(desired);
206
+ const dao = {
207
+ get: {
208
+ byUnique: async () => null,
209
+ byRef: async () => null,
210
+ },
211
+ set: {
212
+ finsert: finsertSpy,
213
+ delete: deleteSpy,
214
+ },
215
+ };
216
+ const provider = new DeclastructProvider_1.DeclastructProvider({
217
+ name: 'test-provider',
218
+ daos: { DemoResource: dao },
219
+ context: {},
220
+ hooks: {
221
+ beforeAll: async () => { },
222
+ afterAll: async () => { },
223
+ },
224
+ });
225
+ const change = new DeclastructChange_1.DeclastructChange({
226
+ forResource: {
227
+ class: DemoResource.name,
228
+ slug: 'replace-1',
229
+ },
230
+ action: DeclastructChange_1.DeclastructChangeAction.REPLACE,
231
+ state: {
232
+ desired,
233
+ remote,
234
+ difference: 'some diff',
235
+ },
236
+ });
237
+ await (0, applyChange_1.applyChange)({
238
+ resource: desired,
239
+ change,
240
+ providers: [provider],
241
+ context: {},
242
+ });
243
+ expect(deleteSpy).toHaveBeenCalledWith(remote, {});
244
+ expect(finsertSpy).toHaveBeenCalledWith(desired, {});
245
+ });
246
+ });
247
+ //# sourceMappingURL=applyChange.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"applyChange.test.js","sourceRoot":"","sources":["../../../src/domain.operations/apply/applyChange.test.ts"],"names":[],"mappings":";;AAAA,mDAA8C;AAC9C,mDAA0C;AAE1C,8EAGgD;AAEhD,kFAA+E;AAC/E,+CAA4C;AAE5C,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAM3B,MAAM,YACJ,SAAQ,6BAA0B;;IAGpB,mBAAM,GAAG,CAAC,IAAI,CAAU,CAAC;IAGzC,EAAE,CAAC,+DAA+D,EAAE,KAAK,IAAI,EAAE;QAC7E,MAAM,QAAQ,GAAG,IAAI,YAAY,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;QAErE,MAAM,MAAM,GAAG,IAAI,qCAAiB,CAAC;YACnC,WAAW,EAAE;gBACX,KAAK,EAAE,YAAY,CAAC,IAAI;gBACxB,IAAI,EAAE,QAAQ;aACf;YACD,MAAM,EAAE,2CAAuB,CAAC,IAAI;YACpC,KAAK,EAAE;gBACL,OAAO,EAAE,QAAQ;gBACjB,MAAM,EAAE,QAAQ;gBAChB,UAAU,EAAE,IAAI;aACjB;SACF,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,MAAM,IAAA,yBAAW,EAAC;YAC/B,QAAQ;YACR,MAAM;YACN,SAAS,EAAE,EAAE;YACb,OAAO,EAAE,EAAE;SACZ,CAAC,CAAC;QAEH,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uCAAuC,EAAE,KAAK,IAAI,EAAE;QACrD,MAAM,QAAQ,GAAG,IAAI,YAAY,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;QACzE,MAAM,UAA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AAI,qCAAiB,CAAC;YACnC,WAAW,EAAE;gBACX,KAAK,EAAE,YAAY,CAAC,IAAI;gBACxB,IAAI,EAAE,WAAW;aAClB;YACD,MAAM,EAAE,2CAAuB,CAAC,OAAO;YACvC,KAAK,EAAE;gBACL,OAAO;gBACP,MAAM;gBACN,UAAU,EAAE,WAAW;aACxB;SACF,CAAC,CAAC;QAEH,MAAM,IAAA,yBAAW,EAAC;YAChB,QAAQ,EAAE,OAAO;YACjB,MAAM;YACN,SAAS,EAAE,CAAC,QAAQ,CAAC;YACrB,OAAO,EAAE,EAAE;SACZ,CAAC,CAAC;QAEH,MAAM,CAAC,SAAS,CAAC,CAAC,oBAAoB,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACnD,MAAM,CAAC,UAAU,CAAC,CAAC,oBAAoB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { DomainEntity } from 'domain-objects';
2
+ import { ContextLogTrail } from 'simple-log-methods';
3
+ import { ContextDeclastruct } from '../../domain.objects/ContextDeclastruct';
4
+ import { DeclastructChange } from '../../domain.objects/DeclastructChange';
5
+ import { DeclastructPlan } from '../../domain.objects/DeclastructPlan';
6
+ import { DeclastructProvider } from '../../domain.objects/DeclastructProvider';
7
+ /**
8
+ * .what = applies a validated plan to achieve desired state
9
+ * .why = executes infrastructure changes in a controlled, observable manner
10
+ * .note = idempotent - reapplying same plan is safe (guards check if already applied)
11
+ */
12
+ export declare const applyChanges: (input: {
13
+ plan: DeclastructPlan;
14
+ resources: DomainEntity<any>[];
15
+ providers: DeclastructProvider<any, any>[];
16
+ }, context: ContextLogTrail & ContextDeclastruct) => Promise<{
17
+ appliedChanges: DeclastructChange[];
18
+ }>;