quidproquo-core 0.1.26 → 0.1.28

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 (173) hide show
  1. package/lib/commonjs/actions/keyValueStore/askKeyValueStoreQuery.d.ts +2 -1
  2. package/lib/commonjs/actions/keyValueStore/askKeyValueStoreQuery.js +1 -0
  3. package/lib/commonjs/actions/keyValueStore/askKeyValueStoreQuery.js.map +1 -1
  4. package/lib/commonjs/config/deploySettings/DEPLOY_SETTING_ENV_PREFIX.d.ts +2 -0
  5. package/lib/commonjs/config/deploySettings/DEPLOY_SETTING_ENV_PREFIX.js +6 -0
  6. package/lib/commonjs/config/deploySettings/DEPLOY_SETTING_ENV_PREFIX.js.map +1 -0
  7. package/lib/commonjs/config/deploySettings/getDeploySetting.d.ts +6 -0
  8. package/lib/commonjs/config/deploySettings/getDeploySetting.js +18 -0
  9. package/lib/commonjs/config/deploySettings/getDeploySetting.js.map +1 -0
  10. package/lib/commonjs/config/deploySettings/getDeploySettingEnvName.d.ts +2 -0
  11. package/lib/commonjs/config/deploySettings/getDeploySettingEnvName.js +8 -0
  12. package/lib/commonjs/config/deploySettings/getDeploySettingEnvName.js.map +1 -0
  13. package/lib/commonjs/config/deploySettings/getDeploySettingList.d.ts +2 -0
  14. package/lib/commonjs/config/deploySettings/getDeploySettingList.js +11 -0
  15. package/lib/commonjs/config/deploySettings/getDeploySettingList.js.map +1 -0
  16. package/lib/commonjs/config/deploySettings/getDeploySettingOrDefault.d.ts +2 -0
  17. package/lib/commonjs/config/deploySettings/getDeploySettingOrDefault.js +8 -0
  18. package/lib/commonjs/config/deploySettings/getDeploySettingOrDefault.js.map +1 -0
  19. package/lib/commonjs/config/deploySettings/index.d.ts +5 -0
  20. package/lib/commonjs/config/deploySettings/index.js +22 -0
  21. package/lib/commonjs/config/deploySettings/index.js.map +1 -0
  22. package/lib/commonjs/config/index.d.ts +1 -0
  23. package/lib/commonjs/config/index.js +1 -0
  24. package/lib/commonjs/config/index.js.map +1 -1
  25. package/lib/commonjs/config/settings/keyValueStore.d.ts +2 -0
  26. package/lib/commonjs/config/settings/keyValueStore.js +20 -5
  27. package/lib/commonjs/config/settings/keyValueStore.js.map +1 -1
  28. package/lib/commonjs/deployment/QpqAppDeployConfig.d.ts +10 -0
  29. package/lib/commonjs/deployment/QpqAppDeployConfig.js +3 -0
  30. package/lib/commonjs/deployment/QpqAppDeployConfig.js.map +1 -0
  31. package/lib/commonjs/deployment/QpqAppDeploySettings.d.ts +6 -0
  32. package/lib/commonjs/deployment/QpqAppDeploySettings.js +3 -0
  33. package/lib/commonjs/deployment/QpqAppDeploySettings.js.map +1 -0
  34. package/lib/commonjs/deployment/QpqAppDeployment.d.ts +11 -0
  35. package/lib/commonjs/deployment/QpqAppDeployment.js +3 -0
  36. package/lib/commonjs/deployment/QpqAppDeployment.js.map +1 -0
  37. package/lib/commonjs/deployment/QpqAppDeploymentBase.d.ts +8 -0
  38. package/lib/commonjs/deployment/QpqAppDeploymentBase.js +3 -0
  39. package/lib/commonjs/deployment/QpqAppDeploymentBase.js.map +1 -0
  40. package/lib/commonjs/deployment/QpqDeployEnvVar.d.ts +12 -0
  41. package/lib/commonjs/deployment/QpqDeployEnvVar.js +18 -0
  42. package/lib/commonjs/deployment/QpqDeployEnvVar.js.map +1 -0
  43. package/lib/commonjs/deployment/index.d.ts +5 -0
  44. package/lib/commonjs/deployment/index.js +22 -0
  45. package/lib/commonjs/deployment/index.js.map +1 -0
  46. package/lib/commonjs/index.d.ts +1 -0
  47. package/lib/commonjs/index.js +1 -0
  48. package/lib/commonjs/index.js.map +1 -1
  49. package/lib/commonjs/logic/index.d.ts +1 -0
  50. package/lib/commonjs/logic/index.js +1 -0
  51. package/lib/commonjs/logic/index.js.map +1 -1
  52. package/lib/commonjs/logic/keyValueStore/KvsIndexNotFoundError.d.ts +5 -0
  53. package/lib/commonjs/logic/keyValueStore/KvsIndexNotFoundError.js +13 -0
  54. package/lib/commonjs/logic/keyValueStore/KvsIndexNotFoundError.js.map +1 -0
  55. package/lib/commonjs/logic/keyValueStore/flattenKvsQueryConditions.d.ts +3 -0
  56. package/lib/commonjs/logic/keyValueStore/flattenKvsQueryConditions.js +15 -0
  57. package/lib/commonjs/logic/keyValueStore/flattenKvsQueryConditions.js.map +1 -0
  58. package/lib/commonjs/logic/keyValueStore/index.d.ts +3 -0
  59. package/lib/commonjs/logic/keyValueStore/index.js +20 -0
  60. package/lib/commonjs/logic/keyValueStore/index.js.map +1 -0
  61. package/lib/commonjs/logic/keyValueStore/resolveKvsQueryIndex.d.ts +10 -0
  62. package/lib/commonjs/logic/keyValueStore/resolveKvsQueryIndex.js +31 -0
  63. package/lib/commonjs/logic/keyValueStore/resolveKvsQueryIndex.js.map +1 -0
  64. package/lib/commonjs/logic/scope/InvalidScopeError.d.ts +5 -1
  65. package/lib/commonjs/logic/scope/InvalidScopeError.js +14 -0
  66. package/lib/commonjs/logic/scope/InvalidScopeError.js.map +1 -1
  67. package/lib/commonjs/logic/scope/index.d.ts +1 -3
  68. package/lib/commonjs/logic/scope/index.js +1 -3
  69. package/lib/commonjs/logic/scope/index.js.map +1 -1
  70. package/lib/commonjs/logic/scope/kvsScopeGate.d.ts +8 -3
  71. package/lib/commonjs/logic/scope/kvsScopeGate.js +32 -35
  72. package/lib/commonjs/logic/scope/kvsScopeGate.js.map +1 -1
  73. package/lib/commonjs/logic/scope/kvsScopeRules.d.ts +61 -0
  74. package/lib/commonjs/logic/scope/kvsScopeRules.js +232 -0
  75. package/lib/commonjs/logic/scope/kvsScopeRules.js.map +1 -0
  76. package/lib/commonjs/logic/scope/validateScopeSegment.js +4 -4
  77. package/lib/commonjs/logic/scope/validateScopeSegment.js.map +1 -1
  78. package/lib/esm/actions/keyValueStore/askKeyValueStoreQuery.d.ts +2 -1
  79. package/lib/esm/actions/keyValueStore/askKeyValueStoreQuery.js +1 -0
  80. package/lib/esm/actions/keyValueStore/askKeyValueStoreQuery.js.map +1 -1
  81. package/lib/esm/config/deploySettings/DEPLOY_SETTING_ENV_PREFIX.d.ts +2 -0
  82. package/lib/esm/config/deploySettings/DEPLOY_SETTING_ENV_PREFIX.js +3 -0
  83. package/lib/esm/config/deploySettings/DEPLOY_SETTING_ENV_PREFIX.js.map +1 -0
  84. package/lib/esm/config/deploySettings/getDeploySetting.d.ts +6 -0
  85. package/lib/esm/config/deploySettings/getDeploySetting.js +14 -0
  86. package/lib/esm/config/deploySettings/getDeploySetting.js.map +1 -0
  87. package/lib/esm/config/deploySettings/getDeploySettingEnvName.d.ts +2 -0
  88. package/lib/esm/config/deploySettings/getDeploySettingEnvName.js +4 -0
  89. package/lib/esm/config/deploySettings/getDeploySettingEnvName.js.map +1 -0
  90. package/lib/esm/config/deploySettings/getDeploySettingList.d.ts +2 -0
  91. package/lib/esm/config/deploySettings/getDeploySettingList.js +7 -0
  92. package/lib/esm/config/deploySettings/getDeploySettingList.js.map +1 -0
  93. package/lib/esm/config/deploySettings/getDeploySettingOrDefault.d.ts +2 -0
  94. package/lib/esm/config/deploySettings/getDeploySettingOrDefault.js +4 -0
  95. package/lib/esm/config/deploySettings/getDeploySettingOrDefault.js.map +1 -0
  96. package/lib/esm/config/deploySettings/index.d.ts +5 -0
  97. package/lib/esm/config/deploySettings/index.js +6 -0
  98. package/lib/esm/config/deploySettings/index.js.map +1 -0
  99. package/lib/esm/config/index.d.ts +1 -0
  100. package/lib/esm/config/index.js +1 -0
  101. package/lib/esm/config/index.js.map +1 -1
  102. package/lib/esm/config/settings/keyValueStore.d.ts +2 -0
  103. package/lib/esm/config/settings/keyValueStore.js +32 -16
  104. package/lib/esm/config/settings/keyValueStore.js.map +1 -1
  105. package/lib/esm/deployment/QpqAppDeployConfig.d.ts +10 -0
  106. package/lib/esm/deployment/QpqAppDeployConfig.js +2 -0
  107. package/lib/esm/deployment/QpqAppDeployConfig.js.map +1 -0
  108. package/lib/esm/deployment/QpqAppDeploySettings.d.ts +6 -0
  109. package/lib/esm/deployment/QpqAppDeploySettings.js +2 -0
  110. package/lib/esm/deployment/QpqAppDeploySettings.js.map +1 -0
  111. package/lib/esm/deployment/QpqAppDeployment.d.ts +11 -0
  112. package/lib/esm/deployment/QpqAppDeployment.js +2 -0
  113. package/lib/esm/deployment/QpqAppDeployment.js.map +1 -0
  114. package/lib/esm/deployment/QpqAppDeploymentBase.d.ts +8 -0
  115. package/lib/esm/deployment/QpqAppDeploymentBase.js +2 -0
  116. package/lib/esm/deployment/QpqAppDeploymentBase.js.map +1 -0
  117. package/lib/esm/deployment/QpqDeployEnvVar.d.ts +12 -0
  118. package/lib/esm/deployment/QpqDeployEnvVar.js +15 -0
  119. package/lib/esm/deployment/QpqDeployEnvVar.js.map +1 -0
  120. package/lib/esm/deployment/index.d.ts +5 -0
  121. package/lib/esm/deployment/index.js +6 -0
  122. package/lib/esm/deployment/index.js.map +1 -0
  123. package/lib/esm/index.d.ts +1 -0
  124. package/lib/esm/index.js +1 -0
  125. package/lib/esm/index.js.map +1 -1
  126. package/lib/esm/logic/index.d.ts +1 -0
  127. package/lib/esm/logic/index.js +1 -0
  128. package/lib/esm/logic/index.js.map +1 -1
  129. package/lib/esm/logic/keyValueStore/KvsIndexNotFoundError.d.ts +5 -0
  130. package/lib/esm/logic/keyValueStore/KvsIndexNotFoundError.js +9 -0
  131. package/lib/esm/logic/keyValueStore/KvsIndexNotFoundError.js.map +1 -0
  132. package/lib/esm/logic/keyValueStore/flattenKvsQueryConditions.d.ts +3 -0
  133. package/lib/esm/logic/keyValueStore/flattenKvsQueryConditions.js +11 -0
  134. package/lib/esm/logic/keyValueStore/flattenKvsQueryConditions.js.map +1 -0
  135. package/lib/esm/logic/keyValueStore/index.d.ts +3 -0
  136. package/lib/esm/logic/keyValueStore/index.js +4 -0
  137. package/lib/esm/logic/keyValueStore/index.js.map +1 -0
  138. package/lib/esm/logic/keyValueStore/resolveKvsQueryIndex.d.ts +10 -0
  139. package/lib/esm/logic/keyValueStore/resolveKvsQueryIndex.js +26 -0
  140. package/lib/esm/logic/keyValueStore/resolveKvsQueryIndex.js.map +1 -0
  141. package/lib/esm/logic/scope/InvalidScopeError.d.ts +5 -1
  142. package/lib/esm/logic/scope/InvalidScopeError.js +14 -0
  143. package/lib/esm/logic/scope/InvalidScopeError.js.map +1 -1
  144. package/lib/esm/logic/scope/index.d.ts +1 -3
  145. package/lib/esm/logic/scope/index.js +1 -3
  146. package/lib/esm/logic/scope/index.js.map +1 -1
  147. package/lib/esm/logic/scope/kvsScopeGate.d.ts +8 -3
  148. package/lib/esm/logic/scope/kvsScopeGate.js +28 -32
  149. package/lib/esm/logic/scope/kvsScopeGate.js.map +1 -1
  150. package/lib/esm/logic/scope/kvsScopeRules.d.ts +61 -0
  151. package/lib/esm/logic/scope/kvsScopeRules.js +220 -0
  152. package/lib/esm/logic/scope/kvsScopeRules.js.map +1 -0
  153. package/lib/esm/logic/scope/validateScopeSegment.js +4 -4
  154. package/lib/esm/logic/scope/validateScopeSegment.js.map +1 -1
  155. package/package.json +2 -2
  156. package/lib/commonjs/logic/scope/scopedKvsQueryOperation.d.ts +0 -42
  157. package/lib/commonjs/logic/scope/scopedKvsQueryOperation.js +0 -128
  158. package/lib/commonjs/logic/scope/scopedKvsQueryOperation.js.map +0 -1
  159. package/lib/commonjs/logic/scope/scopedKvsTranslator.d.ts +0 -32
  160. package/lib/commonjs/logic/scope/scopedKvsTranslator.js +0 -60
  161. package/lib/commonjs/logic/scope/scopedKvsTranslator.js.map +0 -1
  162. package/lib/commonjs/logic/scope/scopedKvsValue.d.ts +0 -12
  163. package/lib/commonjs/logic/scope/scopedKvsValue.js +0 -101
  164. package/lib/commonjs/logic/scope/scopedKvsValue.js.map +0 -1
  165. package/lib/esm/logic/scope/scopedKvsQueryOperation.d.ts +0 -42
  166. package/lib/esm/logic/scope/scopedKvsQueryOperation.js +0 -125
  167. package/lib/esm/logic/scope/scopedKvsQueryOperation.js.map +0 -1
  168. package/lib/esm/logic/scope/scopedKvsTranslator.d.ts +0 -32
  169. package/lib/esm/logic/scope/scopedKvsTranslator.js +0 -62
  170. package/lib/esm/logic/scope/scopedKvsTranslator.js.map +0 -1
  171. package/lib/esm/logic/scope/scopedKvsValue.d.ts +0 -12
  172. package/lib/esm/logic/scope/scopedKvsValue.js +0 -91
  173. package/lib/esm/logic/scope/scopedKvsValue.js.map +0 -1
@@ -9,11 +9,12 @@ export type KeyValueStoreQueryOptions = {
9
9
  nextPageKey?: string;
10
10
  filter?: KvsQueryOperation;
11
11
  scope?: string;
12
+ indexName?: string;
12
13
  consistentRead?: boolean;
13
14
  };
14
15
  export declare const askKeyValueStoreQueryBase: import("../..").ActionRequesterFunction<KeyValueStoreActionType.Query, [keyValueStoreName: string, keyCondition: KvsQueryOperation, options?: KeyValueStoreQueryOptions | undefined], {
15
16
  keyValueStoreName: string;
16
17
  keyCondition: KvsQueryOperation;
17
18
  options: KeyValueStoreQueryOptions | undefined;
18
- }, QpqPagedData<unknown>, "ResourceNotFound" | "ServiceUnavailable" | "InvalidScope" | "StoreNotFound">;
19
+ }, QpqPagedData<unknown>, "ResourceNotFound" | "ServiceUnavailable" | "InvalidScope" | "StoreNotFound" | "IndexNotFound">;
19
20
  export declare function askKeyValueStoreQuery<KvsItem>(keyValueStoreName: string, keyCondition: KvsQueryOperation, options?: KeyValueStoreQueryOptions): AskResponse<QpqPagedData<KvsItem>>;
@@ -11,6 +11,7 @@ exports.askKeyValueStoreQueryBase = (0, createActionRequester_1.createActionRequ
11
11
  'ResourceNotFound', // the underlying table does not exist
12
12
  'InvalidScope', // scope is malformed or the store's partition key is not string-typed
13
13
  'StoreNotFound', // the store is not declared in the qpq config (misconfiguration)
14
+ 'IndexNotFound', // `indexName` names an index the store doesn't declare (misconfiguration)
14
15
  ],
15
16
  getPayload: (keyValueStoreName, keyCondition, options) => ({
16
17
  keyValueStoreName,
@@ -1 +1 @@
1
- {"version":3,"file":"askKeyValueStoreQuery.js","sourceRoot":"","sources":["../../../../src/actions/keyValueStore/askKeyValueStoreQuery.ts"],"names":[],"mappings":";;;AA8CA,sDAOC;AAnDD,mFAAgF;AAChF,uEAAoE;AA0BvD,QAAA,yBAAyB,GAAG,IAAA,6CAAqB,GAAyB,CAAC;IACtF,UAAU,EAAE,iDAAuB,CAAC,KAAK;IACzC,UAAU,EAAE;QACV,oBAAoB,EAAE,uCAAuC;QAC7D,kBAAkB,EAAE,sCAAsC;QAC1D,cAAc,EAAE,sEAAsE;QACtF,eAAe,EAAE,iEAAiE;KACnF;IACD,UAAU,EAAE,CAAC,iBAAyB,EAAE,YAA+B,EAAE,OAAmC,EAAE,EAAE,CAAC,CAAC;QAChH,iBAAiB;QACjB,YAAY;QACZ,OAAO;KACR,CAAC;CACH,CAAC,CAAC;AAEH,uFAAuF;AACvF,6DAA6D;AAC7D,QAAe,CAAC,CAAC,qBAAqB,CACpC,iBAAyB,EAEzB,YAA+B,EAC/B,OAAmC;IAEnC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAA,iCAAyB,EAAC,iBAAiB,EAAE,YAAY,EAAE,OAAO,CAAC,CAA0B,CAAC;AAC/G,CAAC","sourcesContent":["import { QpqPagedData } from '../../types/QpqPagedData';\nimport { AskResponse } from '../../types/StorySession';\nimport { createActionRequester } from '../../types/utils/createActionRequester';\nimport { KeyValueStoreActionType } from './KeyValueStoreActionType';\nimport { KvsQueryOperation } from './types';\n\nexport type KeyValueStoreQueryOptions = {\n // Accepted but not implemented: no processor applies a TTL to query results.\n ttlInSeconds?: number;\n sortAscending?: boolean;\n limit?: number;\n nextPageKey?: string;\n filter?: KvsQueryOperation;\n // Composed into partition-key conditions by the processor; requires a string-typed partition key.\n scope?: string;\n // Read the writer's own most recent writes, at the cost of a slower and (on DynamoDB) doubly-charged\n // read.\n //\n // Default reads are EVENTUALLY consistent, which is right for a viewer and wrong for a caller that just\n // wrote and is now reading back to decide something. That case is not hypothetical: a flow run appends\n // its terminal event and immediately re-lists the log to fold the outcome, and under load the terminal\n // event is intermittently not yet visible — so a run that succeeded reads back as having no outcome at\n // all, with nothing recorded to explain it.\n //\n // Use it for read-your-own-writes and for any fold used as a COORDINATION primitive (deciding \"am I\n // last\", \"did this finish\"). Do not use it for ordinary reads.\n consistentRead?: boolean;\n};\n\nexport const askKeyValueStoreQueryBase = createActionRequester<QpqPagedData<unknown>>()({\n actionType: KeyValueStoreActionType.Query,\n errorTypes: [\n 'ServiceUnavailable', // DynamoDB internal error / throttling\n 'ResourceNotFound', // the underlying table does not exist\n 'InvalidScope', // scope is malformed or the store's partition key is not string-typed\n 'StoreNotFound', // the store is not declared in the qpq config (misconfiguration)\n ],\n getPayload: (keyValueStoreName: string, keyCondition: KvsQueryOperation, options?: KeyValueStoreQueryOptions) => ({\n keyValueStoreName,\n keyCondition,\n options,\n }),\n});\n\n// The stored item shape is only known to the caller, so the base returns unknown items\n// and this story casts the page to what the caller declared.\nexport function* askKeyValueStoreQuery<KvsItem>(\n keyValueStoreName: string,\n\n keyCondition: KvsQueryOperation,\n options?: KeyValueStoreQueryOptions,\n): AskResponse<QpqPagedData<KvsItem>> {\n return (yield* askKeyValueStoreQueryBase(keyValueStoreName, keyCondition, options)) as QpqPagedData<KvsItem>;\n}\n"]}
1
+ {"version":3,"file":"askKeyValueStoreQuery.js","sourceRoot":"","sources":["../../../../src/actions/keyValueStore/askKeyValueStoreQuery.ts"],"names":[],"mappings":";;;AAmDA,sDAOC;AAxDD,mFAAgF;AAChF,uEAAoE;AA8BvD,QAAA,yBAAyB,GAAG,IAAA,6CAAqB,GAAyB,CAAC;IACtF,UAAU,EAAE,iDAAuB,CAAC,KAAK;IACzC,UAAU,EAAE;QACV,oBAAoB,EAAE,uCAAuC;QAC7D,kBAAkB,EAAE,sCAAsC;QAC1D,cAAc,EAAE,sEAAsE;QACtF,eAAe,EAAE,iEAAiE;QAClF,eAAe,EAAE,0EAA0E;KAC5F;IACD,UAAU,EAAE,CAAC,iBAAyB,EAAE,YAA+B,EAAE,OAAmC,EAAE,EAAE,CAAC,CAAC;QAChH,iBAAiB;QACjB,YAAY;QACZ,OAAO;KACR,CAAC;CACH,CAAC,CAAC;AAEH,uFAAuF;AACvF,6DAA6D;AAC7D,QAAe,CAAC,CAAC,qBAAqB,CACpC,iBAAyB,EAEzB,YAA+B,EAC/B,OAAmC;IAEnC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAA,iCAAyB,EAAC,iBAAiB,EAAE,YAAY,EAAE,OAAO,CAAC,CAA0B,CAAC;AAC/G,CAAC","sourcesContent":["import { QpqPagedData } from '../../types/QpqPagedData';\nimport { AskResponse } from '../../types/StorySession';\nimport { createActionRequester } from '../../types/utils/createActionRequester';\nimport { KeyValueStoreActionType } from './KeyValueStoreActionType';\nimport { KvsQueryOperation } from './types';\n\nexport type KeyValueStoreQueryOptions = {\n // Accepted but not implemented: no processor applies a TTL to query results.\n ttlInSeconds?: number;\n sortAscending?: boolean;\n limit?: number;\n nextPageKey?: string;\n filter?: KvsQueryOperation;\n // Composed into partition-key conditions by the processor; requires a string-typed partition key.\n scope?: string;\n // Query the declared index with this name (which defaults to its partition key attribute) and read in\n // its sort order. Without it the table, or else the first index, whose keys cover the key condition\n // serves it, so an index sharing the table's keys is only used when named here.\n indexName?: string;\n // Read the writer's own most recent writes, at the cost of a slower and (on DynamoDB) doubly-charged\n // read.\n //\n // Default reads are EVENTUALLY consistent, which is right for a viewer and wrong for a caller that just\n // wrote and is now reading back to decide something. That case is not hypothetical: a flow run appends\n // its terminal event and immediately re-lists the log to fold the outcome, and under load the terminal\n // event is intermittently not yet visible — so a run that succeeded reads back as having no outcome at\n // all, with nothing recorded to explain it.\n //\n // Use it for read-your-own-writes and for any fold used as a COORDINATION primitive (deciding \"am I\n // last\", \"did this finish\"). Do not use it for ordinary reads.\n consistentRead?: boolean;\n};\n\nexport const askKeyValueStoreQueryBase = createActionRequester<QpqPagedData<unknown>>()({\n actionType: KeyValueStoreActionType.Query,\n errorTypes: [\n 'ServiceUnavailable', // DynamoDB internal error / throttling\n 'ResourceNotFound', // the underlying table does not exist\n 'InvalidScope', // scope is malformed or the store's partition key is not string-typed\n 'StoreNotFound', // the store is not declared in the qpq config (misconfiguration)\n 'IndexNotFound', // `indexName` names an index the store doesn't declare (misconfiguration)\n ],\n getPayload: (keyValueStoreName: string, keyCondition: KvsQueryOperation, options?: KeyValueStoreQueryOptions) => ({\n keyValueStoreName,\n keyCondition,\n options,\n }),\n});\n\n// The stored item shape is only known to the caller, so the base returns unknown items\n// and this story casts the page to what the caller declared.\nexport function* askKeyValueStoreQuery<KvsItem>(\n keyValueStoreName: string,\n\n keyCondition: KvsQueryOperation,\n options?: KeyValueStoreQueryOptions,\n): AskResponse<QpqPagedData<KvsItem>> {\n return (yield* askKeyValueStoreQueryBase(keyValueStoreName, keyCondition, options)) as QpqPagedData<KvsItem>;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ /** Prefix on the env var each deploy setting is delivered through. */
2
+ export declare const DEPLOY_SETTING_ENV_PREFIX = "DEPLOY_SETTING_";
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEPLOY_SETTING_ENV_PREFIX = void 0;
4
+ /** Prefix on the env var each deploy setting is delivered through. */
5
+ exports.DEPLOY_SETTING_ENV_PREFIX = 'DEPLOY_SETTING_';
6
+ //# sourceMappingURL=DEPLOY_SETTING_ENV_PREFIX.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DEPLOY_SETTING_ENV_PREFIX.js","sourceRoot":"","sources":["../../../../src/config/deploySettings/DEPLOY_SETTING_ENV_PREFIX.ts"],"names":[],"mappings":";;;AAAA,sEAAsE;AACzD,QAAA,yBAAyB,GAAG,iBAAiB,CAAC","sourcesContent":["/** Prefix on the env var each deploy setting is delivered through. */\nexport const DEPLOY_SETTING_ENV_PREFIX = 'DEPLOY_SETTING_';\n"]}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * A deploy setting from the selected deployment's `settings` in deploy.config.json,
3
+ * for use in infrastructure.ts and config helpers. Throws when the setting is not
4
+ * defined, so a typo can't deploy an empty value.
5
+ */
6
+ export declare const getDeploySetting: (key: string) => string;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getDeploySetting = void 0;
4
+ const getDeploySettingEnvName_1 = require("./getDeploySettingEnvName");
5
+ /**
6
+ * A deploy setting from the selected deployment's `settings` in deploy.config.json,
7
+ * for use in infrastructure.ts and config helpers. Throws when the setting is not
8
+ * defined, so a typo can't deploy an empty value.
9
+ */
10
+ const getDeploySetting = (key) => {
11
+ const value = process.env[(0, getDeploySettingEnvName_1.getDeploySettingEnvName)(key)];
12
+ if (value === undefined) {
13
+ throw new Error(`Deploy setting '${key}' is not defined. Add it to the deployment's "settings" in deploy.config.json.`);
14
+ }
15
+ return value;
16
+ };
17
+ exports.getDeploySetting = getDeploySetting;
18
+ //# sourceMappingURL=getDeploySetting.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getDeploySetting.js","sourceRoot":"","sources":["../../../../src/config/deploySettings/getDeploySetting.ts"],"names":[],"mappings":";;;AAAA,uEAAoE;AAEpE;;;;GAIG;AACI,MAAM,gBAAgB,GAAG,CAAC,GAAW,EAAU,EAAE;IACtD,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,IAAA,iDAAuB,EAAC,GAAG,CAAC,CAAC,CAAC;IAExD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,mBAAmB,GAAG,gFAAgF,CAAC,CAAC;IAC1H,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AARW,QAAA,gBAAgB,oBAQ3B","sourcesContent":["import { getDeploySettingEnvName } from './getDeploySettingEnvName';\n\n/**\n * A deploy setting from the selected deployment's `settings` in deploy.config.json,\n * for use in infrastructure.ts and config helpers. Throws when the setting is not\n * defined, so a typo can't deploy an empty value.\n */\nexport const getDeploySetting = (key: string): string => {\n const value = process.env[getDeploySettingEnvName(key)];\n\n if (value === undefined) {\n throw new Error(`Deploy setting '${key}' is not defined. Add it to the deployment's \"settings\" in deploy.config.json.`);\n }\n\n return value;\n};\n"]}
@@ -0,0 +1,2 @@
1
+ /** The env var that carries the deploy setting `key` (the key is used verbatim, no case conversion). */
2
+ export declare const getDeploySettingEnvName: (key: string) => string;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getDeploySettingEnvName = void 0;
4
+ const DEPLOY_SETTING_ENV_PREFIX_1 = require("./DEPLOY_SETTING_ENV_PREFIX");
5
+ /** The env var that carries the deploy setting `key` (the key is used verbatim, no case conversion). */
6
+ const getDeploySettingEnvName = (key) => `${DEPLOY_SETTING_ENV_PREFIX_1.DEPLOY_SETTING_ENV_PREFIX}${key}`;
7
+ exports.getDeploySettingEnvName = getDeploySettingEnvName;
8
+ //# sourceMappingURL=getDeploySettingEnvName.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getDeploySettingEnvName.js","sourceRoot":"","sources":["../../../../src/config/deploySettings/getDeploySettingEnvName.ts"],"names":[],"mappings":";;;AAAA,2EAAwE;AAExE,wGAAwG;AACjG,MAAM,uBAAuB,GAAG,CAAC,GAAW,EAAU,EAAE,CAAC,GAAG,qDAAyB,GAAG,GAAG,EAAE,CAAC;AAAxF,QAAA,uBAAuB,2BAAiE","sourcesContent":["import { DEPLOY_SETTING_ENV_PREFIX } from './DEPLOY_SETTING_ENV_PREFIX';\n\n/** The env var that carries the deploy setting `key` (the key is used verbatim, no case conversion). */\nexport const getDeploySettingEnvName = (key: string): string => `${DEPLOY_SETTING_ENV_PREFIX}${key}`;\n"]}
@@ -0,0 +1,2 @@
1
+ /** A comma-separated deploy setting as a trimmed list, empty items dropped. Throws like `getDeploySetting` when unset. */
2
+ export declare const getDeploySettingList: (key: string) => string[];
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getDeploySettingList = void 0;
4
+ const getDeploySetting_1 = require("./getDeploySetting");
5
+ /** A comma-separated deploy setting as a trimmed list, empty items dropped. Throws like `getDeploySetting` when unset. */
6
+ const getDeploySettingList = (key) => (0, getDeploySetting_1.getDeploySetting)(key)
7
+ .split(',')
8
+ .map((item) => item.trim())
9
+ .filter(Boolean);
10
+ exports.getDeploySettingList = getDeploySettingList;
11
+ //# sourceMappingURL=getDeploySettingList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getDeploySettingList.js","sourceRoot":"","sources":["../../../../src/config/deploySettings/getDeploySettingList.ts"],"names":[],"mappings":";;;AAAA,yDAAsD;AAEtD,0HAA0H;AACnH,MAAM,oBAAoB,GAAG,CAAC,GAAW,EAAY,EAAE,CAC5D,IAAA,mCAAgB,EAAC,GAAG,CAAC;KAClB,KAAK,CAAC,GAAG,CAAC;KACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;KAC1B,MAAM,CAAC,OAAO,CAAC,CAAC;AAJR,QAAA,oBAAoB,wBAIZ","sourcesContent":["import { getDeploySetting } from './getDeploySetting';\n\n/** A comma-separated deploy setting as a trimmed list, empty items dropped. Throws like `getDeploySetting` when unset. */\nexport const getDeploySettingList = (key: string): string[] =>\n getDeploySetting(key)\n .split(',')\n .map((item) => item.trim())\n .filter(Boolean);\n"]}
@@ -0,0 +1,2 @@
1
+ /** A deploy setting from the selected deployment, or `fallback` when the deployment does not define it. */
2
+ export declare const getDeploySettingOrDefault: (key: string, fallback: string) => string;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getDeploySettingOrDefault = void 0;
4
+ const getDeploySettingEnvName_1 = require("./getDeploySettingEnvName");
5
+ /** A deploy setting from the selected deployment, or `fallback` when the deployment does not define it. */
6
+ const getDeploySettingOrDefault = (key, fallback) => { var _a; return (_a = process.env[(0, getDeploySettingEnvName_1.getDeploySettingEnvName)(key)]) !== null && _a !== void 0 ? _a : fallback; };
7
+ exports.getDeploySettingOrDefault = getDeploySettingOrDefault;
8
+ //# sourceMappingURL=getDeploySettingOrDefault.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getDeploySettingOrDefault.js","sourceRoot":"","sources":["../../../../src/config/deploySettings/getDeploySettingOrDefault.ts"],"names":[],"mappings":";;;AAAA,uEAAoE;AAEpE,2GAA2G;AACpG,MAAM,yBAAyB,GAAG,CAAC,GAAW,EAAE,QAAgB,EAAU,EAAE,WAAC,OAAA,MAAA,OAAO,CAAC,GAAG,CAAC,IAAA,iDAAuB,EAAC,GAAG,CAAC,CAAC,mCAAI,QAAQ,CAAA,EAAA,CAAC;AAA7H,QAAA,yBAAyB,6BAAoG","sourcesContent":["import { getDeploySettingEnvName } from './getDeploySettingEnvName';\n\n/** A deploy setting from the selected deployment, or `fallback` when the deployment does not define it. */\nexport const getDeploySettingOrDefault = (key: string, fallback: string): string => process.env[getDeploySettingEnvName(key)] ?? fallback;\n"]}
@@ -0,0 +1,5 @@
1
+ export * from './DEPLOY_SETTING_ENV_PREFIX';
2
+ export * from './getDeploySetting';
3
+ export * from './getDeploySettingEnvName';
4
+ export * from './getDeploySettingList';
5
+ export * from './getDeploySettingOrDefault';
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./DEPLOY_SETTING_ENV_PREFIX"), exports);
18
+ __exportStar(require("./getDeploySetting"), exports);
19
+ __exportStar(require("./getDeploySettingEnvName"), exports);
20
+ __exportStar(require("./getDeploySettingList"), exports);
21
+ __exportStar(require("./getDeploySettingOrDefault"), exports);
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/config/deploySettings/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA4C;AAC5C,qDAAmC;AACnC,4DAA0C;AAC1C,yDAAuC;AACvC,8DAA4C","sourcesContent":["export * from './DEPLOY_SETTING_ENV_PREFIX';\nexport * from './getDeploySetting';\nexport * from './getDeploySettingEnvName';\nexport * from './getDeploySettingList';\nexport * from './getDeploySettingOrDefault';\n"]}
@@ -1,3 +1,4 @@
1
+ export * from './deploySettings';
1
2
  export * from './QPQConfig';
2
3
  export * from './settings';
3
4
  export * from './utils';
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./deploySettings"), exports);
17
18
  __exportStar(require("./QPQConfig"), exports);
18
19
  __exportStar(require("./settings"), exports);
19
20
  __exportStar(require("./utils"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,6CAA2B;AAC3B,0CAAwB","sourcesContent":["export * from './QPQConfig';\nexport * from './settings';\nexport * from './utils';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,8CAA4B;AAC5B,6CAA2B;AAC3B,0CAAwB","sourcesContent":["export * from './deploySettings';\nexport * from './QPQConfig';\nexport * from './settings';\nexport * from './utils';\n"]}
@@ -6,12 +6,14 @@ export type KvsKey<T extends object = any> = {
6
6
  type: KvsKeyType;
7
7
  };
8
8
  export type KvsIndex<T extends object = any> = {
9
+ name: string;
9
10
  partitionKey: KvsKey<T>;
10
11
  sortKey?: KvsKey<T>;
11
12
  };
12
13
  export declare const kvsKey: <T extends object = any>(key: KeyOf<T>, type?: KvsKeyType) => KvsKey<T>;
13
14
  type CompositeKvsKey<T extends object = any> = KvsKey<T> | KeyOf<T>;
14
15
  type CompositeCompositeKvsIndex<T extends object = any> = {
16
+ name?: string;
15
17
  partitionKey: CompositeKvsKey<T>;
16
18
  sortKey?: CompositeKvsKey<T>;
17
19
  };
@@ -19,25 +19,40 @@ const isCompositeKvsIndexACompositeCompositeKvsIndex = (compositeKvsIndex) => {
19
19
  return typeof compositeKvsIndex !== 'string';
20
20
  };
21
21
  const convertCompositeKvsIndexToKvsIndex = (compositeKvsIndex) => {
22
+ var _a;
22
23
  if (!isCompositeKvsIndexACompositeCompositeKvsIndex(compositeKvsIndex)) {
23
24
  return {
25
+ name: compositeKvsIndex,
24
26
  partitionKey: (0, exports.kvsKey)(compositeKvsIndex, 'string'),
25
27
  };
26
28
  }
29
+ const partitionKey = convertCompositeKvsKeyToKvsKey(compositeKvsIndex.partitionKey);
27
30
  return {
28
- partitionKey: convertCompositeKvsKeyToKvsKey(compositeKvsIndex.partitionKey),
31
+ name: (_a = compositeKvsIndex.name) !== null && _a !== void 0 ? _a : partitionKey.key,
32
+ partitionKey,
29
33
  sortKey: compositeKvsIndex.sortKey ? convertCompositeKvsKeyToKvsKey(compositeKvsIndex.sortKey) : undefined,
30
34
  };
31
35
  };
32
36
  const defineKeyValueStore = (keyValueStoreName, partitionKey, sortKeys = [], options) => {
33
37
  var _a, _b, _c, _d;
34
- return ({
38
+ const tablePartitionKey = convertCompositeKvsKeyToKvsKey(partitionKey);
39
+ const indexes = ((_a = options === null || options === void 0 ? void 0 : options.indexes) !== null && _a !== void 0 ? _a : []).map((convertCompositeKvsIndexToKvsIndex));
40
+ const duplicateIndexName = indexes.find((index, position) => indexes.findIndex((other) => other.name === index.name) !== position);
41
+ if (duplicateIndexName) {
42
+ throw new Error(`Key value store '${keyValueStoreName}' declares two indexes named '${duplicateIndexName.name}'; give one an explicit name`);
43
+ }
44
+ // A scoped store's indexes are partitioned per scope, which every backend can do
45
+ // for a string or number key but not a binary one.
46
+ if ((options === null || options === void 0 ? void 0 : options.scoped) && indexes.some((index) => index.partitionKey.type === 'binary' && index.partitionKey.key !== tablePartitionKey.key)) {
47
+ throw new Error(`Key value store '${keyValueStoreName}' is scoped, so its index partition keys must be strings or numbers`);
48
+ }
49
+ return {
35
50
  configSettingType: QPQConfig_1.QPQCoreConfigSettingType.keyValueStore,
36
51
  uniqueKey: keyValueStoreName,
37
52
  keyValueStoreName,
38
- partitionKey: convertCompositeKvsKeyToKvsKey(partitionKey),
53
+ partitionKey: tablePartitionKey,
39
54
  sortKeys: sortKeys.map((convertCompositeKvsKeyToKvsKey)),
40
- indexes: ((_a = options === null || options === void 0 ? void 0 : options.indexes) !== null && _a !== void 0 ? _a : []).map((convertCompositeKvsIndexToKvsIndex)),
55
+ indexes,
41
56
  global: (_b = options === null || options === void 0 ? void 0 : options.global) !== null && _b !== void 0 ? _b : false,
42
57
  owner: options === null || options === void 0 ? void 0 : options.owner,
43
58
  ttlAttribute: options === null || options === void 0 ? void 0 : options.ttlAttribute,
@@ -45,7 +60,7 @@ const defineKeyValueStore = (keyValueStoreName, partitionKey, sortKeys = [], opt
45
60
  cryptoKeyName: options === null || options === void 0 ? void 0 : options.cryptoKeyName,
46
61
  scoped: (_d = options === null || options === void 0 ? void 0 : options.scoped) !== null && _d !== void 0 ? _d : false,
47
62
  onStream: options === null || options === void 0 ? void 0 : options.onStream,
48
- });
63
+ };
49
64
  };
50
65
  exports.defineKeyValueStore = defineKeyValueStore;
51
66
  //# sourceMappingURL=keyValueStore.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"keyValueStore.js","sourceRoot":"","sources":["../../../../src/config/settings/keyValueStore.ts"],"names":[],"mappings":";;;AACA,4CAAqG;AAmB9F,MAAM,MAAM,GAAG,CAAyB,GAAa,EAAE,OAAmB,QAAQ,EAAa,EAAE,CAAC,CAAC;IACxG,GAAG;IACH,IAAI;CACL,CAAC,CAAC;AAHU,QAAA,MAAM,UAGhB;AAWH,MAAM,8BAA8B,GAAG,CAAyB,eAAmC,EAAa,EAAE;IAChH,oBAAoB;IACpB,IAAI,OAAO,eAAe,KAAK,QAAQ,EAAE,CAAC;QACxC,OAAO,IAAA,cAAM,EAAI,eAA2B,EAAE,QAAQ,CAAC,CAAC;IAC1D,CAAC;IAED,sBAAsB;IACtB,OAAO,eAA4B,CAAC;AACtC,CAAC,CAAC;AAEF,MAAM,8CAA8C,GAAG,CACrD,iBAAuC,EACa,EAAE;IACtD,OAAO,OAAO,iBAAiB,KAAK,QAAQ,CAAC;AAC/C,CAAC,CAAC;AAEF,MAAM,kCAAkC,GAAG,CAAyB,iBAAuC,EAAe,EAAE;IAC1H,IAAI,CAAC,8CAA8C,CAAI,iBAAiB,CAAC,EAAE,CAAC;QAC1E,OAAO;YACL,YAAY,EAAE,IAAA,cAAM,EAAI,iBAAiB,EAAE,QAAQ,CAAC;SACrD,CAAC;IACJ,CAAC;IAED,OAAO;QACL,YAAY,EAAE,8BAA8B,CAAI,iBAAiB,CAAC,YAAY,CAAC;QAC/E,OAAO,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,8BAA8B,CAAI,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS;KAC9G,CAAC;AACJ,CAAC,CAAC;AAuFK,MAAM,mBAAmB,GAAG,CACjC,iBAAyB,EAEzB,YAAgC,EAChC,WAAiC,EAAE,EAEnC,OAAmD,EACjB,EAAE;;IAAC,OAAA,CAAC;QACtC,iBAAiB,EAAE,oCAAwB,CAAC,aAAa;QACzD,SAAS,EAAE,iBAAiB;QAE5B,iBAAiB;QAEjB,YAAY,EAAE,8BAA8B,CAAI,YAAY,CAAC;QAC7D,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAA,8BAAiC,CAAA,CAAC;QAEzD,OAAO,EAAE,CAAC,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,mCAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAA,kCAAqC,CAAA,CAAC;QAE5E,MAAM,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,mCAAI,KAAK;QAEhC,KAAK,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK;QAErB,YAAY,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY;QAEnC,0BAA0B,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,0BAA0B,mCAAI,KAAK;QAExE,aAAa,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,aAAa;QACrC,MAAM,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,mCAAI,KAAK;QAEhC,QAAQ,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ;KAC5B,CAAC,CAAA;CAAA,CAAC;AA9BU,QAAA,mBAAmB,uBA8B7B","sourcesContent":["import { CrossModuleOwner, KeyOf, QpqFunctionRuntime } from '../../types';\nimport { QPQConfigAdvancedSettings, QPQConfigSetting, QPQCoreConfigSettingType } from '../QPQConfig';\n\n// TODO: When we put validation on the QPQConfig, we need to make sure\n// Key Length and Data Type: DynamoDB has limitations on key length and data type.\n// Your KvsKeyType only supports 'string', 'number', and 'binary' types. Make sure\n// that you're validating these in convertKvsKeyToDynamodbAttribute function and\n// also ensure that key length is within DynamoDB's specified limits.\n\nexport type KvsKeyType = 'string' | 'number' | 'binary';\nexport type KvsKey<T extends object = any> = {\n key: KeyOf<T>;\n type: KvsKeyType;\n};\n\nexport type KvsIndex<T extends object = any> = {\n partitionKey: KvsKey<T>;\n sortKey?: KvsKey<T>;\n};\n\nexport const kvsKey = <T extends object = any>(key: KeyOf<T>, type: KvsKeyType = 'string'): KvsKey<T> => ({\n key,\n type,\n});\n\ntype CompositeKvsKey<T extends object = any> = KvsKey<T> | KeyOf<T>;\n\ntype CompositeCompositeKvsIndex<T extends object = any> = {\n partitionKey: CompositeKvsKey<T>;\n sortKey?: CompositeKvsKey<T>;\n};\n\nexport type CompositeKvsIndex<T extends object = any> = KeyOf<T> | CompositeCompositeKvsIndex<T>;\n\nconst convertCompositeKvsKeyToKvsKey = <T extends object = any>(compositeKvsKey: CompositeKvsKey<T>): KvsKey<T> => {\n // Must be a keyof T\n if (typeof compositeKvsKey === 'string') {\n return kvsKey<T>(compositeKvsKey as KeyOf<T>, 'string');\n }\n\n // must be a KvsKey<T>\n return compositeKvsKey as KvsKey<T>;\n};\n\nconst isCompositeKvsIndexACompositeCompositeKvsIndex = <T extends object = any>(\n compositeKvsIndex: CompositeKvsIndex<T>,\n): compositeKvsIndex is CompositeCompositeKvsIndex<T> => {\n return typeof compositeKvsIndex !== 'string';\n};\n\nconst convertCompositeKvsIndexToKvsIndex = <T extends object = any>(compositeKvsIndex: CompositeKvsIndex<T>): KvsIndex<T> => {\n if (!isCompositeKvsIndexACompositeCompositeKvsIndex<T>(compositeKvsIndex)) {\n return {\n partitionKey: kvsKey<T>(compositeKvsIndex, 'string'),\n };\n }\n\n return {\n partitionKey: convertCompositeKvsKeyToKvsKey<T>(compositeKvsIndex.partitionKey),\n sortKey: compositeKvsIndex.sortKey ? convertCompositeKvsKeyToKvsKey<T>(compositeKvsIndex.sortKey) : undefined,\n };\n};\n\n/**\n * Change data capture on a store: the table gets a stream (NEW_AND_OLD_IMAGES) and\n * `runtime` is invoked with the changes.\n *\n * Records arrive in order PER PARTITION KEY, and different partition keys are processed\n * concurrently. A stream handler therefore gets one-writer-per-item serialisation for\n * free, which is what makes a stream the natural place to maintain a projection of a table\n * you only ever append to — no queue, no extra write on the append path, and no trigger to\n * lose, because the record exists precisely because the write happened.\n *\n * Mirrors defineStorageDrive's `onEvent`.\n */\nexport type KvsStreamSettings = {\n runtime: QpqFunctionRuntime;\n\n /**\n * Collapse each delivered batch down to ONE record per partition key, keeping the latest.\n *\n * Off by default: a generic consumer (audit trail, change notifications) needs to see\n * every change, and the framework should never silently drop records.\n *\n * On for a PROJECTION, where the payload that matters is \"this key changed\" and the\n * handler re-derives from source anyway. Without it, the batch is fanned back out into\n * one story run per record and the batching bought nothing: 500 appends to one document\n * would mean 500 re-derivations, each reading a log that grows as it goes. With it, that\n * batch is a single re-derivation.\n */\n coalesceByPartitionKey?: boolean;\n\n /** Records per invocation. DynamoDB streams allow up to 1000; the mapping default is 100. */\n batchSize?: number;\n\n /**\n * How long to wait accumulating records before invoking, 0 to 300 seconds. Trades\n * projection latency for far fewer invocations, and gives coalescing more to collapse.\n */\n maximumBatchingWindowInSeconds?: number;\n};\n\nexport interface QPQConfigAdvancedKeyValueStoreSettings<T extends object = any> extends QPQConfigAdvancedSettings {\n indexes?: CompositeKvsIndex<T>[];\n\n global?: boolean;\n\n owner?: CrossModuleOwner;\n\n ttlAttribute?: string;\n\n // Point-in-time recovery (35-day continuous backups) is on by default; set this to opt out.\n disablePointInTimeRecovery?: boolean;\n\n // Encrypt the table with the named defineCryptoKey instead of the provider's own managed\n // encryption, which always applies. The key must be declared in the same config, owned or\n // foreign; a foreign key's owning service must be deployed first.\n cryptoKeyName?: string;\n\n // Every action on this store must carry a scope; an unscoped call is refused rather\n // than hitting the unpartitioned rows. askKeyValueStoreScanAllScopes is exempt.\n scoped?: boolean;\n\n // Turn on change data capture — see KvsStreamSettings. Absent means no stream is\n // created at all.\n onStream?: KvsStreamSettings;\n}\n\nexport interface KeyValueStoreQPQConfigSetting<T extends object = any> extends QPQConfigSetting {\n keyValueStoreName: string;\n\n partitionKey: KvsKey<T>;\n sortKeys: KvsKey<T>[];\n\n indexes: KvsIndex<T>[];\n\n global: boolean;\n\n ttlAttribute?: string;\n\n disablePointInTimeRecovery: boolean;\n\n cryptoKeyName?: string;\n scoped: boolean;\n\n onStream?: KvsStreamSettings;\n}\n\nexport const defineKeyValueStore = <T extends object = any>(\n keyValueStoreName: string,\n\n partitionKey: CompositeKvsKey<T>,\n sortKeys: CompositeKvsKey<T>[] = [],\n\n options?: QPQConfigAdvancedKeyValueStoreSettings<T>,\n): KeyValueStoreQPQConfigSetting<T> => ({\n configSettingType: QPQCoreConfigSettingType.keyValueStore,\n uniqueKey: keyValueStoreName,\n\n keyValueStoreName,\n\n partitionKey: convertCompositeKvsKeyToKvsKey<T>(partitionKey),\n sortKeys: sortKeys.map(convertCompositeKvsKeyToKvsKey<T>),\n\n indexes: (options?.indexes ?? []).map(convertCompositeKvsIndexToKvsIndex<T>),\n\n global: options?.global ?? false,\n\n owner: options?.owner,\n\n ttlAttribute: options?.ttlAttribute,\n\n disablePointInTimeRecovery: options?.disablePointInTimeRecovery ?? false,\n\n cryptoKeyName: options?.cryptoKeyName,\n scoped: options?.scoped ?? false,\n\n onStream: options?.onStream,\n});\n"]}
1
+ {"version":3,"file":"keyValueStore.js","sourceRoot":"","sources":["../../../../src/config/settings/keyValueStore.ts"],"names":[],"mappings":";;;AACA,4CAAqG;AAqB9F,MAAM,MAAM,GAAG,CAAyB,GAAa,EAAE,OAAmB,QAAQ,EAAa,EAAE,CAAC,CAAC;IACxG,GAAG;IACH,IAAI;CACL,CAAC,CAAC;AAHU,QAAA,MAAM,UAGhB;AAaH,MAAM,8BAA8B,GAAG,CAAyB,eAAmC,EAAa,EAAE;IAChH,oBAAoB;IACpB,IAAI,OAAO,eAAe,KAAK,QAAQ,EAAE,CAAC;QACxC,OAAO,IAAA,cAAM,EAAI,eAA2B,EAAE,QAAQ,CAAC,CAAC;IAC1D,CAAC;IAED,sBAAsB;IACtB,OAAO,eAA4B,CAAC;AACtC,CAAC,CAAC;AAEF,MAAM,8CAA8C,GAAG,CACrD,iBAAuC,EACa,EAAE;IACtD,OAAO,OAAO,iBAAiB,KAAK,QAAQ,CAAC;AAC/C,CAAC,CAAC;AAEF,MAAM,kCAAkC,GAAG,CAAyB,iBAAuC,EAAe,EAAE;;IAC1H,IAAI,CAAC,8CAA8C,CAAI,iBAAiB,CAAC,EAAE,CAAC;QAC1E,OAAO;YACL,IAAI,EAAE,iBAAiB;YACvB,YAAY,EAAE,IAAA,cAAM,EAAI,iBAAiB,EAAE,QAAQ,CAAC;SACrD,CAAC;IACJ,CAAC;IAED,MAAM,YAAY,GAAG,8BAA8B,CAAI,iBAAiB,CAAC,YAAY,CAAC,CAAC;IAEvF,OAAO;QACL,IAAI,EAAE,MAAA,iBAAiB,CAAC,IAAI,mCAAI,YAAY,CAAC,GAAG;QAChD,YAAY;QACZ,OAAO,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,8BAA8B,CAAI,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS;KAC9G,CAAC;AACJ,CAAC,CAAC;AAuFK,MAAM,mBAAmB,GAAG,CACjC,iBAAyB,EAEzB,YAAgC,EAChC,WAAiC,EAAE,EAEnC,OAAmD,EACjB,EAAE;;IACpC,MAAM,iBAAiB,GAAG,8BAA8B,CAAI,YAAY,CAAC,CAAC;IAC1E,MAAM,OAAO,GAAG,CAAC,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,mCAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAA,kCAAqC,CAAA,CAAC,CAAC;IAEpF,MAAM,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,CAAC,KAAK,QAAQ,CAAC,CAAC;IACnI,IAAI,kBAAkB,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,oBAAoB,iBAAiB,iCAAiC,kBAAkB,CAAC,IAAI,8BAA8B,CAAC,CAAC;IAC/I,CAAC;IAED,iFAAiF;IACjF,mDAAmD;IACnD,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,KAAI,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,YAAY,CAAC,GAAG,KAAK,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;QACzI,MAAM,IAAI,KAAK,CAAC,oBAAoB,iBAAiB,qEAAqE,CAAC,CAAC;IAC9H,CAAC;IAED,OAAO;QACL,iBAAiB,EAAE,oCAAwB,CAAC,aAAa;QACzD,SAAS,EAAE,iBAAiB;QAE5B,iBAAiB;QAEjB,YAAY,EAAE,iBAAiB;QAC/B,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAA,8BAAiC,CAAA,CAAC;QAEzD,OAAO;QAEP,MAAM,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,mCAAI,KAAK;QAEhC,KAAK,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK;QAErB,YAAY,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY;QAEnC,0BAA0B,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,0BAA0B,mCAAI,KAAK;QAExE,aAAa,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,aAAa;QACrC,MAAM,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,mCAAI,KAAK;QAEhC,QAAQ,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ;KAC5B,CAAC;AACJ,CAAC,CAAC;AA9CW,QAAA,mBAAmB,uBA8C9B","sourcesContent":["import { CrossModuleOwner, KeyOf, QpqFunctionRuntime } from '../../types';\nimport { QPQConfigAdvancedSettings, QPQConfigSetting, QPQCoreConfigSettingType } from '../QPQConfig';\n\n// TODO: When we put validation on the QPQConfig, we need to make sure\n// Key Length and Data Type: DynamoDB has limitations on key length and data type.\n// Your KvsKeyType only supports 'string', 'number', and 'binary' types. Make sure\n// that you're validating these in convertKvsKeyToDynamodbAttribute function and\n// also ensure that key length is within DynamoDB's specified limits.\n\nexport type KvsKeyType = 'string' | 'number' | 'binary';\nexport type KvsKey<T extends object = any> = {\n key: KeyOf<T>;\n type: KvsKeyType;\n};\n\nexport type KvsIndex<T extends object = any> = {\n // What the index is queried by (askKeyValueStoreQuery's `indexName` option) and deployed as.\n name: string;\n partitionKey: KvsKey<T>;\n sortKey?: KvsKey<T>;\n};\n\nexport const kvsKey = <T extends object = any>(key: KeyOf<T>, type: KvsKeyType = 'string'): KvsKey<T> => ({\n key,\n type,\n});\n\ntype CompositeKvsKey<T extends object = any> = KvsKey<T> | KeyOf<T>;\n\ntype CompositeCompositeKvsIndex<T extends object = any> = {\n // Defaults to the partition key attribute. Name an index when two share a partition key.\n name?: string;\n partitionKey: CompositeKvsKey<T>;\n sortKey?: CompositeKvsKey<T>;\n};\n\nexport type CompositeKvsIndex<T extends object = any> = KeyOf<T> | CompositeCompositeKvsIndex<T>;\n\nconst convertCompositeKvsKeyToKvsKey = <T extends object = any>(compositeKvsKey: CompositeKvsKey<T>): KvsKey<T> => {\n // Must be a keyof T\n if (typeof compositeKvsKey === 'string') {\n return kvsKey<T>(compositeKvsKey as KeyOf<T>, 'string');\n }\n\n // must be a KvsKey<T>\n return compositeKvsKey as KvsKey<T>;\n};\n\nconst isCompositeKvsIndexACompositeCompositeKvsIndex = <T extends object = any>(\n compositeKvsIndex: CompositeKvsIndex<T>,\n): compositeKvsIndex is CompositeCompositeKvsIndex<T> => {\n return typeof compositeKvsIndex !== 'string';\n};\n\nconst convertCompositeKvsIndexToKvsIndex = <T extends object = any>(compositeKvsIndex: CompositeKvsIndex<T>): KvsIndex<T> => {\n if (!isCompositeKvsIndexACompositeCompositeKvsIndex<T>(compositeKvsIndex)) {\n return {\n name: compositeKvsIndex,\n partitionKey: kvsKey<T>(compositeKvsIndex, 'string'),\n };\n }\n\n const partitionKey = convertCompositeKvsKeyToKvsKey<T>(compositeKvsIndex.partitionKey);\n\n return {\n name: compositeKvsIndex.name ?? partitionKey.key,\n partitionKey,\n sortKey: compositeKvsIndex.sortKey ? convertCompositeKvsKeyToKvsKey<T>(compositeKvsIndex.sortKey) : undefined,\n };\n};\n\n/**\n * Change data capture on a store: the table gets a stream (NEW_AND_OLD_IMAGES) and\n * `runtime` is invoked with the changes.\n *\n * Records arrive in order PER PARTITION KEY, and different partition keys are processed\n * concurrently. A stream handler therefore gets one-writer-per-item serialisation for\n * free, which is what makes a stream the natural place to maintain a projection of a table\n * you only ever append to — no queue, no extra write on the append path, and no trigger to\n * lose, because the record exists precisely because the write happened.\n *\n * Mirrors defineStorageDrive's `onEvent`.\n */\nexport type KvsStreamSettings = {\n runtime: QpqFunctionRuntime;\n\n /**\n * Collapse each delivered batch down to ONE record per partition key, keeping the latest.\n *\n * Off by default: a generic consumer (audit trail, change notifications) needs to see\n * every change, and the framework should never silently drop records.\n *\n * On for a PROJECTION, where the payload that matters is \"this key changed\" and the\n * handler re-derives from source anyway. Without it, the batch is fanned back out into\n * one story run per record and the batching bought nothing: 500 appends to one document\n * would mean 500 re-derivations, each reading a log that grows as it goes. With it, that\n * batch is a single re-derivation.\n */\n coalesceByPartitionKey?: boolean;\n\n /** Records per invocation. DynamoDB streams allow up to 1000; the mapping default is 100. */\n batchSize?: number;\n\n /**\n * How long to wait accumulating records before invoking, 0 to 300 seconds. Trades\n * projection latency for far fewer invocations, and gives coalescing more to collapse.\n */\n maximumBatchingWindowInSeconds?: number;\n};\n\nexport interface QPQConfigAdvancedKeyValueStoreSettings<T extends object = any> extends QPQConfigAdvancedSettings {\n indexes?: CompositeKvsIndex<T>[];\n\n global?: boolean;\n\n owner?: CrossModuleOwner;\n\n ttlAttribute?: string;\n\n // Point-in-time recovery (35-day continuous backups) is on by default; set this to opt out.\n disablePointInTimeRecovery?: boolean;\n\n // Encrypt the table with the named defineCryptoKey instead of the provider's own managed\n // encryption, which always applies. The key must be declared in the same config, owned or\n // foreign; a foreign key's owning service must be deployed first.\n cryptoKeyName?: string;\n\n // Every action on this store must carry a scope; an unscoped call is refused rather\n // than hitting the unpartitioned rows. askKeyValueStoreScanAllScopes is exempt.\n scoped?: boolean;\n\n // Turn on change data capture — see KvsStreamSettings. Absent means no stream is\n // created at all.\n onStream?: KvsStreamSettings;\n}\n\nexport interface KeyValueStoreQPQConfigSetting<T extends object = any> extends QPQConfigSetting {\n keyValueStoreName: string;\n\n partitionKey: KvsKey<T>;\n sortKeys: KvsKey<T>[];\n\n indexes: KvsIndex<T>[];\n\n global: boolean;\n\n ttlAttribute?: string;\n\n disablePointInTimeRecovery: boolean;\n\n cryptoKeyName?: string;\n scoped: boolean;\n\n onStream?: KvsStreamSettings;\n}\n\nexport const defineKeyValueStore = <T extends object = any>(\n keyValueStoreName: string,\n\n partitionKey: CompositeKvsKey<T>,\n sortKeys: CompositeKvsKey<T>[] = [],\n\n options?: QPQConfigAdvancedKeyValueStoreSettings<T>,\n): KeyValueStoreQPQConfigSetting<T> => {\n const tablePartitionKey = convertCompositeKvsKeyToKvsKey<T>(partitionKey);\n const indexes = (options?.indexes ?? []).map(convertCompositeKvsIndexToKvsIndex<T>);\n\n const duplicateIndexName = indexes.find((index, position) => indexes.findIndex((other) => other.name === index.name) !== position);\n if (duplicateIndexName) {\n throw new Error(`Key value store '${keyValueStoreName}' declares two indexes named '${duplicateIndexName.name}'; give one an explicit name`);\n }\n\n // A scoped store's indexes are partitioned per scope, which every backend can do\n // for a string or number key but not a binary one.\n if (options?.scoped && indexes.some((index) => index.partitionKey.type === 'binary' && index.partitionKey.key !== tablePartitionKey.key)) {\n throw new Error(`Key value store '${keyValueStoreName}' is scoped, so its index partition keys must be strings or numbers`);\n }\n\n return {\n configSettingType: QPQCoreConfigSettingType.keyValueStore,\n uniqueKey: keyValueStoreName,\n\n keyValueStoreName,\n\n partitionKey: tablePartitionKey,\n sortKeys: sortKeys.map(convertCompositeKvsKeyToKvsKey<T>),\n\n indexes,\n\n global: options?.global ?? false,\n\n owner: options?.owner,\n\n ttlAttribute: options?.ttlAttribute,\n\n disablePointInTimeRecovery: options?.disablePointInTimeRecovery ?? false,\n\n cryptoKeyName: options?.cryptoKeyName,\n scoped: options?.scoped ?? false,\n\n onStream: options?.onStream,\n };\n};\n"]}
@@ -0,0 +1,10 @@
1
+ import { QpqAppDeployment } from './QpqAppDeployment';
2
+ /**
3
+ * apps/<app>/deploy.config.json: the single source of truth for where and as what
4
+ * an app deploys. Kept as JSON so tooling can read it before any TS executes. Nothing
5
+ * in it is overridden by env vars or flags; to change a value, change the file or add
6
+ * an entry. Holds identity and settings only, never credentials.
7
+ */
8
+ export type QpqAppDeployConfig = {
9
+ deployments: Record<string, QpqAppDeployment>;
10
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=QpqAppDeployConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QpqAppDeployConfig.js","sourceRoot":"","sources":["../../../src/deployment/QpqAppDeployConfig.ts"],"names":[],"mappings":"","sourcesContent":["import { QpqAppDeployment } from './QpqAppDeployment';\n\n/**\n * apps/<app>/deploy.config.json: the single source of truth for where and as what\n * an app deploys. Kept as JSON so tooling can read it before any TS executes. Nothing\n * in it is overridden by env vars or flags; to change a value, change the file or add\n * an entry. Holds identity and settings only, never credentials.\n */\nexport type QpqAppDeployConfig = {\n // deployment name -> target. The name is what `qpq go --deployment <name>` selects.\n deployments: Record<string, QpqAppDeployment>;\n};\n"]}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Per-deployment values handed to infrastructure.ts as `DEPLOY_SETTING_<key>` env vars
3
+ * (read them with `getDeploySetting` from quidproquo-core). Keys are used verbatim as
4
+ * the env var suffix, values are always strings. Committed in cleartext: never a secret.
5
+ */
6
+ export type QpqAppDeploySettings = Record<string, string>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=QpqAppDeploySettings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QpqAppDeploySettings.js","sourceRoot":"","sources":["../../../src/deployment/QpqAppDeploySettings.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Per-deployment values handed to infrastructure.ts as `DEPLOY_SETTING_<key>` env vars\n * (read them with `getDeploySetting` from quidproquo-core). Keys are used verbatim as\n * the env var suffix, values are always strings. Committed in cleartext: never a secret.\n */\nexport type QpqAppDeploySettings = Record<string, string>;\n"]}
@@ -0,0 +1,11 @@
1
+ import { QpqAppDeploymentBase } from './QpqAppDeploymentBase';
2
+ /**
3
+ * One entry under `deployments` in apps/<app>/deploy.config.json. `platform` names the
4
+ * CLI driver; `platformSettings` is a flat string map, like `settings`, whose required
5
+ * keys each platform checks for itself (quidproquo-config-aws for aws), so this layer
6
+ * stays open to platforms it has never heard of.
7
+ */
8
+ export type QpqAppDeployment = QpqAppDeploymentBase & {
9
+ platform: string;
10
+ platformSettings?: Record<string, string>;
11
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=QpqAppDeployment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QpqAppDeployment.js","sourceRoot":"","sources":["../../../src/deployment/QpqAppDeployment.ts"],"names":[],"mappings":"","sourcesContent":["import { QpqAppDeploymentBase } from './QpqAppDeploymentBase';\n\n/**\n * One entry under `deployments` in apps/<app>/deploy.config.json. `platform` names the\n * CLI driver; `platformSettings` is a flat string map, like `settings`, whose required\n * keys each platform checks for itself (quidproquo-config-aws for aws), so this layer\n * stays open to platforms it has never heard of.\n */\nexport type QpqAppDeployment = QpqAppDeploymentBase & {\n platform: string;\n platformSettings?: Record<string, string>;\n};\n"]}
@@ -0,0 +1,8 @@
1
+ import { QpqAppDeploySettings } from './QpqAppDeploySettings';
2
+ /** The identity every deployment carries, whatever platform it targets. */
3
+ export type QpqAppDeploymentBase = {
4
+ name: string;
5
+ environment: string;
6
+ feature?: string;
7
+ settings?: QpqAppDeploySettings;
8
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=QpqAppDeploymentBase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QpqAppDeploymentBase.js","sourceRoot":"","sources":["../../../src/deployment/QpqAppDeploymentBase.ts"],"names":[],"mappings":"","sourcesContent":["import { QpqAppDeploySettings } from './QpqAppDeploySettings';\n\n/** The identity every deployment carries, whatever platform it targets. */\nexport type QpqAppDeploymentBase = {\n // Application name: prefixes every stack and resource, so two deployments of one\n // codebase with different names (say two products built from one repo) never share anything.\n name: string;\n\n environment: string;\n\n // Optional feature/actor suffix for a personal or feature-branch stack set.\n feature?: string;\n\n settings?: QpqAppDeploySettings;\n};\n"]}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * The env vars a selected deployment is delivered through. Service configs and deploy
3
+ * tooling read these at load time, so they are primed before any infrastructure.ts is
4
+ * required. Platform identity vars are declared by the platform (see quidproquo-config-aws).
5
+ */
6
+ export declare enum QpqDeployEnvVar {
7
+ deployAppName = "DEPLOY_APP_NAME",
8
+ deployName = "DEPLOY_NAME",
9
+ applicationName = "APPLICATION_NAME",
10
+ environment = "ENVIRONMENT",
11
+ featureName = "FEATURE_NAME"
12
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.QpqDeployEnvVar = void 0;
4
+ /**
5
+ * The env vars a selected deployment is delivered through. Service configs and deploy
6
+ * tooling read these at load time, so they are primed before any infrastructure.ts is
7
+ * required. Platform identity vars are declared by the platform (see quidproquo-config-aws).
8
+ */
9
+ var QpqDeployEnvVar;
10
+ (function (QpqDeployEnvVar) {
11
+ // The app folder under apps/ and the deployment name within its deploy.config.json.
12
+ QpqDeployEnvVar["deployAppName"] = "DEPLOY_APP_NAME";
13
+ QpqDeployEnvVar["deployName"] = "DEPLOY_NAME";
14
+ QpqDeployEnvVar["applicationName"] = "APPLICATION_NAME";
15
+ QpqDeployEnvVar["environment"] = "ENVIRONMENT";
16
+ QpqDeployEnvVar["featureName"] = "FEATURE_NAME";
17
+ })(QpqDeployEnvVar || (exports.QpqDeployEnvVar = QpqDeployEnvVar = {}));
18
+ //# sourceMappingURL=QpqDeployEnvVar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QpqDeployEnvVar.js","sourceRoot":"","sources":["../../../src/deployment/QpqDeployEnvVar.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,IAAY,eAQX;AARD,WAAY,eAAe;IACzB,oFAAoF;IACpF,oDAAiC,CAAA;IACjC,6CAA0B,CAAA;IAE1B,uDAAoC,CAAA;IACpC,8CAA2B,CAAA;IAC3B,+CAA4B,CAAA;AAC9B,CAAC,EARW,eAAe,+BAAf,eAAe,QAQ1B","sourcesContent":["/**\n * The env vars a selected deployment is delivered through. Service configs and deploy\n * tooling read these at load time, so they are primed before any infrastructure.ts is\n * required. Platform identity vars are declared by the platform (see quidproquo-config-aws).\n */\nexport enum QpqDeployEnvVar {\n // The app folder under apps/ and the deployment name within its deploy.config.json.\n deployAppName = 'DEPLOY_APP_NAME',\n deployName = 'DEPLOY_NAME',\n\n applicationName = 'APPLICATION_NAME',\n environment = 'ENVIRONMENT',\n featureName = 'FEATURE_NAME',\n}\n"]}
@@ -0,0 +1,5 @@
1
+ export * from './QpqAppDeployConfig';
2
+ export * from './QpqAppDeployment';
3
+ export * from './QpqAppDeploymentBase';
4
+ export * from './QpqAppDeploySettings';
5
+ export * from './QpqDeployEnvVar';
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./QpqAppDeployConfig"), exports);
18
+ __exportStar(require("./QpqAppDeployment"), exports);
19
+ __exportStar(require("./QpqAppDeploymentBase"), exports);
20
+ __exportStar(require("./QpqAppDeploySettings"), exports);
21
+ __exportStar(require("./QpqDeployEnvVar"), exports);
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/deployment/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,qDAAmC;AACnC,yDAAuC;AACvC,yDAAuC;AACvC,oDAAkC","sourcesContent":["export * from './QpqAppDeployConfig';\nexport * from './QpqAppDeployment';\nexport * from './QpqAppDeploymentBase';\nexport * from './QpqAppDeploySettings';\nexport * from './QpqDeployEnvVar';\n"]}
@@ -2,6 +2,7 @@ export * from './actions';
2
2
  export * from './config';
3
3
  export * from './constants';
4
4
  export * from './createImplementationRuntime';
5
+ export * from './deployment';
5
6
  export * from './logic';
6
7
  export * from './logic/actionLogic';
7
8
  export * from './proiseify';
@@ -18,6 +18,7 @@ __exportStar(require("./actions"), exports);
18
18
  __exportStar(require("./config"), exports);
19
19
  __exportStar(require("./constants"), exports);
20
20
  __exportStar(require("./createImplementationRuntime"), exports);
21
+ __exportStar(require("./deployment"), exports);
21
22
  __exportStar(require("./logic"), exports);
22
23
  __exportStar(require("./logic/actionLogic"), exports);
23
24
  __exportStar(require("./proiseify"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,2CAAyB;AACzB,8CAA4B;AAC5B,gEAA8C;AAC9C,0CAAwB;AACxB,sDAAoC;AACpC,8CAA4B;AAC5B,oDAAkC;AAClC,kDAAgC;AAChC,4CAA0B;AAC1B,4CAA0B;AAC1B,4CAA0B;AAC1B,0CAAwB;AACxB,0CAAwB;AACxB,+CAA6B","sourcesContent":["export * from './actions';\nexport * from './config';\nexport * from './constants';\nexport * from './createImplementationRuntime';\nexport * from './logic';\nexport * from './logic/actionLogic';\nexport * from './proiseify';\nexport * from './qpqCoreUtilsLib';\nexport * from './qpqExecuteLog';\nexport * from './runtime';\nexport * from './stories';\nexport * from './testing';\nexport * from './types';\nexport * from './utils';\nexport * from './validators';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,2CAAyB;AACzB,8CAA4B;AAC5B,gEAA8C;AAC9C,+CAA6B;AAC7B,0CAAwB;AACxB,sDAAoC;AACpC,8CAA4B;AAC5B,oDAAkC;AAClC,kDAAgC;AAChC,4CAA0B;AAC1B,4CAA0B;AAC1B,4CAA0B;AAC1B,0CAAwB;AACxB,0CAAwB;AACxB,+CAA6B","sourcesContent":["export * from './actions';\nexport * from './config';\nexport * from './constants';\nexport * from './createImplementationRuntime';\nexport * from './deployment';\nexport * from './logic';\nexport * from './logic/actionLogic';\nexport * from './proiseify';\nexport * from './qpqCoreUtilsLib';\nexport * from './qpqExecuteLog';\nexport * from './runtime';\nexport * from './stories';\nexport * from './testing';\nexport * from './types';\nexport * from './utils';\nexport * from './validators';\n"]}
@@ -2,6 +2,7 @@ export * from './actionValidators';
2
2
  export * from './context';
3
3
  export * from './decomposedString';
4
4
  export * from './error';
5
+ export * from './keyValueStore';
5
6
  export * from './logHistory';
6
7
  export * from './lookup';
7
8
  export * from './scope';
@@ -18,6 +18,7 @@ __exportStar(require("./actionValidators"), exports);
18
18
  __exportStar(require("./context"), exports);
19
19
  __exportStar(require("./decomposedString"), exports);
20
20
  __exportStar(require("./error"), exports);
21
+ __exportStar(require("./keyValueStore"), exports);
21
22
  __exportStar(require("./logHistory"), exports);
22
23
  __exportStar(require("./lookup"), exports);
23
24
  __exportStar(require("./scope"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/logic/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,4CAA0B;AAC1B,qDAAmC;AACnC,0CAAwB;AACxB,+CAA6B;AAC7B,2CAAyB;AACzB,0CAAwB;AACxB,iDAA+B;AAC/B,2CAAyB;AACzB,wDAAsC","sourcesContent":["export * from './actionValidators';\nexport * from './context';\nexport * from './decomposedString';\nexport * from './error';\nexport * from './logHistory';\nexport * from './lookup';\nexport * from './scope';\nexport * from './stateEffects';\nexport * from './stream';\nexport * from './transientErrorNames';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/logic/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,4CAA0B;AAC1B,qDAAmC;AACnC,0CAAwB;AACxB,kDAAgC;AAChC,+CAA6B;AAC7B,2CAAyB;AACzB,0CAAwB;AACxB,iDAA+B;AAC/B,2CAAyB;AACzB,wDAAsC","sourcesContent":["export * from './actionValidators';\nexport * from './context';\nexport * from './decomposedString';\nexport * from './error';\nexport * from './keyValueStore';\nexport * from './logHistory';\nexport * from './lookup';\nexport * from './scope';\nexport * from './stateEffects';\nexport * from './stream';\nexport * from './transientErrorNames';\n"]}
@@ -0,0 +1,5 @@
1
+ /** A query named an index its store doesn't declare. Query processors map it to the action's IndexNotFound. */
2
+ export declare class KvsIndexNotFoundError extends Error {
3
+ readonly code = "KvsIndexNotFoundError";
4
+ constructor(keyValueStoreName: string, indexName: string);
5
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.KvsIndexNotFoundError = void 0;
4
+ /** A query named an index its store doesn't declare. Query processors map it to the action's IndexNotFound. */
5
+ class KvsIndexNotFoundError extends Error {
6
+ constructor(keyValueStoreName, indexName) {
7
+ super(`Key value store '${keyValueStoreName}' has no index named '${indexName}'`);
8
+ this.code = 'KvsIndexNotFoundError';
9
+ this.name = 'KvsIndexNotFoundError';
10
+ }
11
+ }
12
+ exports.KvsIndexNotFoundError = KvsIndexNotFoundError;
13
+ //# sourceMappingURL=KvsIndexNotFoundError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KvsIndexNotFoundError.js","sourceRoot":"","sources":["../../../../src/logic/keyValueStore/KvsIndexNotFoundError.ts"],"names":[],"mappings":";;;AAAA,+GAA+G;AAC/G,MAAa,qBAAsB,SAAQ,KAAK;IAG9C,YAAY,iBAAyB,EAAE,SAAiB;QACtD,KAAK,CAAC,oBAAoB,iBAAiB,yBAAyB,SAAS,GAAG,CAAC,CAAC;QAH3E,SAAI,GAAG,uBAAuB,CAAC;QAItC,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;IACtC,CAAC;CACF;AAPD,sDAOC","sourcesContent":["/** A query named an index its store doesn't declare. Query processors map it to the action's IndexNotFound. */\nexport class KvsIndexNotFoundError extends Error {\n readonly code = 'KvsIndexNotFoundError';\n\n constructor(keyValueStoreName: string, indexName: string) {\n super(`Key value store '${keyValueStoreName}' has no index named '${indexName}'`);\n this.name = 'KvsIndexNotFoundError';\n }\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import { KvsQueryCondition, KvsQueryOperation } from '../../actions/keyValueStore/types';
2
+ /** Flatten a query tree into its leaf conditions, in traversal order. Malformed nodes are dropped. */
3
+ export declare const flattenKvsQueryConditions: (operation: KvsQueryOperation) => KvsQueryCondition[];
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.flattenKvsQueryConditions = void 0;
4
+ /** Flatten a query tree into its leaf conditions, in traversal order. Malformed nodes are dropped. */
5
+ const flattenKvsQueryConditions = (operation) => {
6
+ if ('key' in operation && 'operation' in operation) {
7
+ return [operation];
8
+ }
9
+ if ('conditions' in operation && 'operation' in operation) {
10
+ return operation.conditions.flatMap(exports.flattenKvsQueryConditions);
11
+ }
12
+ return [];
13
+ };
14
+ exports.flattenKvsQueryConditions = flattenKvsQueryConditions;
15
+ //# sourceMappingURL=flattenKvsQueryConditions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flattenKvsQueryConditions.js","sourceRoot":"","sources":["../../../../src/logic/keyValueStore/flattenKvsQueryConditions.ts"],"names":[],"mappings":";;;AAEA,sGAAsG;AAC/F,MAAM,yBAAyB,GAAG,CAAC,SAA4B,EAAuB,EAAE;IAC7F,IAAI,KAAK,IAAI,SAAS,IAAI,WAAW,IAAI,SAAS,EAAE,CAAC;QACnD,OAAO,CAAC,SAAS,CAAC,CAAC;IACrB,CAAC;IAED,IAAI,YAAY,IAAI,SAAS,IAAI,WAAW,IAAI,SAAS,EAAE,CAAC;QAC1D,OAAO,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC,iCAAyB,CAAC,CAAC;IACjE,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC;AAVW,QAAA,yBAAyB,6BAUpC","sourcesContent":["import { KvsQueryCondition, KvsQueryOperation } from '../../actions/keyValueStore/types';\n\n/** Flatten a query tree into its leaf conditions, in traversal order. Malformed nodes are dropped. */\nexport const flattenKvsQueryConditions = (operation: KvsQueryOperation): KvsQueryCondition[] => {\n if ('key' in operation && 'operation' in operation) {\n return [operation];\n }\n\n if ('conditions' in operation && 'operation' in operation) {\n return operation.conditions.flatMap(flattenKvsQueryConditions);\n }\n\n return [];\n};\n"]}