@qpqjs/core 0.4.0 → 0.6.0
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.
- package/lib/commonjs/config/settings/keyValueStore/defineKeyValueStore.d.ts +1 -1
- package/lib/commonjs/config/settings/keyValueStore/defineKeyValueStore.js.map +1 -1
- package/lib/commonjs/config/settings/keyValueStore/types/CompositeCompositeKvsIndex.d.ts +7 -0
- package/lib/commonjs/config/settings/keyValueStore/types/CompositeCompositeKvsIndex.js +3 -0
- package/lib/commonjs/config/settings/keyValueStore/types/CompositeCompositeKvsIndex.js.map +1 -0
- package/lib/commonjs/config/settings/keyValueStore/types/CompositeKvsIndex.d.ts +2 -7
- package/lib/commonjs/config/settings/keyValueStore/types/CompositeKvsIndex.js.map +1 -1
- package/lib/commonjs/config/settings/keyValueStore/types/CompositeKvsKey.d.ts +4 -0
- package/lib/commonjs/{types/ActionOverride.js → config/settings/keyValueStore/types/CompositeKvsKey.js} +1 -1
- package/lib/commonjs/config/settings/keyValueStore/types/CompositeKvsKey.js.map +1 -0
- package/lib/commonjs/config/settings/keyValueStore/types/index.d.ts +2 -0
- package/lib/commonjs/config/settings/keyValueStore/types/index.js +2 -0
- package/lib/commonjs/config/settings/keyValueStore/types/index.js.map +1 -1
- package/lib/commonjs/logic/config/getForeignItems.d.ts +3 -0
- package/lib/commonjs/logic/config/getForeignItems.js +11 -0
- package/lib/commonjs/logic/config/getForeignItems.js.map +1 -0
- package/lib/commonjs/logic/config/index.d.ts +1 -0
- package/lib/commonjs/logic/config/index.js +1 -0
- package/lib/commonjs/logic/config/index.js.map +1 -1
- package/lib/commonjs/logic/graphDatabase/GraphResultConverters.d.ts +11 -0
- package/lib/commonjs/logic/graphDatabase/GraphResultConverters.js +3 -0
- package/lib/commonjs/logic/graphDatabase/GraphResultConverters.js.map +1 -0
- package/lib/commonjs/logic/graphDatabase/createAnyGraphResultConverter.d.ts +1 -10
- package/lib/commonjs/logic/graphDatabase/createAnyGraphResultConverter.js.map +1 -1
- package/lib/commonjs/logic/graphDatabase/index.d.ts +1 -0
- package/lib/commonjs/logic/graphDatabase/index.js +1 -0
- package/lib/commonjs/logic/graphDatabase/index.js.map +1 -1
- package/lib/commonjs/qpqCoreUtils.d.ts +1 -1
- package/lib/commonjs/qpqCoreUtils.js +3 -2
- package/lib/commonjs/qpqCoreUtils.js.map +1 -1
- package/lib/commonjs/qpqCoreUtilsLib.d.ts +1 -0
- package/lib/commonjs/stories/paging/PagedDataDrainOptions.d.ts +6 -0
- package/lib/commonjs/stories/paging/PagedDataDrainOptions.js +3 -0
- package/lib/commonjs/stories/paging/PagedDataDrainOptions.js.map +1 -0
- package/lib/commonjs/stories/paging/askPagedDataDrain.d.ts +1 -4
- package/lib/commonjs/stories/paging/askPagedDataDrain.js.map +1 -1
- package/lib/commonjs/stories/paging/index.d.ts +1 -0
- package/lib/commonjs/stories/paging/index.js +1 -0
- package/lib/commonjs/stories/paging/index.js.map +1 -1
- package/lib/commonjs/stories/system/overrideActions/AskOverrideSlot.d.ts +2 -0
- package/lib/commonjs/stories/system/overrideActions/AskOverrideSlot.js +3 -0
- package/lib/commonjs/stories/system/overrideActions/AskOverrideSlot.js.map +1 -0
- package/lib/commonjs/stories/system/overrideActions/OverrideBatchSlot.d.ts +7 -0
- package/lib/commonjs/stories/system/overrideActions/OverrideBatchSlot.js +3 -0
- package/lib/commonjs/stories/system/overrideActions/OverrideBatchSlot.js.map +1 -0
- package/lib/commonjs/stories/system/overrideActions/askOverrideActions.d.ts +1 -1
- package/lib/commonjs/stories/system/overrideActions/askOverrideActions.js.map +1 -1
- package/lib/commonjs/stories/system/overrideActions/askOverrideBatch.d.ts +2 -2
- package/lib/commonjs/stories/system/overrideActions/askOverrideBatch.js +3 -15
- package/lib/commonjs/stories/system/overrideActions/askOverrideBatch.js.map +1 -1
- package/lib/commonjs/stories/system/overrideActions/askOverrideSlotRun.d.ts +11 -0
- package/lib/commonjs/stories/system/overrideActions/askOverrideSlotRun.js +23 -0
- package/lib/commonjs/stories/system/overrideActions/askOverrideSlotRun.js.map +1 -0
- package/lib/commonjs/stories/system/overrideActions/getOwnOverrideHandler.d.ts +2 -1
- package/lib/commonjs/stories/system/overrideActions/getOwnOverrideHandler.js.map +1 -1
- package/lib/commonjs/stories/system/overrideActions/index.d.ts +1 -0
- package/lib/commonjs/stories/system/overrideActions/index.js +1 -0
- package/lib/commonjs/stories/system/overrideActions/index.js.map +1 -1
- package/lib/commonjs/types/{ActionOverride.d.ts → ActionOverrideHandler.d.ts} +0 -3
- package/lib/commonjs/types/ActionOverrideHandler.js +3 -0
- package/lib/commonjs/types/ActionOverrideHandler.js.map +1 -0
- package/lib/commonjs/types/ActionOverrideMap.d.ts +4 -0
- package/lib/commonjs/types/ActionOverrideMap.js +3 -0
- package/lib/commonjs/types/ActionOverrideMap.js.map +1 -0
- package/lib/commonjs/types/authChallenge/CreateAuthChallengeEvent.d.ts +5 -0
- package/lib/commonjs/types/authChallenge/CreateAuthChallengeEvent.js.map +1 -1
- package/lib/commonjs/types/authChallenge/DefineAuthChallengeEvent.d.ts +5 -0
- package/lib/commonjs/types/authChallenge/DefineAuthChallengeEvent.js.map +1 -1
- package/lib/commonjs/types/index.d.ts +2 -1
- package/lib/commonjs/types/index.js +2 -1
- package/lib/commonjs/types/index.js.map +1 -1
- package/lib/commonjs/utils/functions/index.d.ts +1 -0
- package/lib/commonjs/utils/functions/index.js +1 -0
- package/lib/commonjs/utils/functions/index.js.map +1 -1
- package/lib/commonjs/utils/functions/sleep.d.ts +2 -0
- package/lib/commonjs/utils/functions/sleep.js +7 -0
- package/lib/commonjs/utils/functions/sleep.js.map +1 -0
- package/lib/esm/config/settings/keyValueStore/defineKeyValueStore.d.ts +1 -1
- package/lib/esm/config/settings/keyValueStore/defineKeyValueStore.js.map +1 -1
- package/lib/esm/config/settings/keyValueStore/types/CompositeCompositeKvsIndex.d.ts +7 -0
- package/lib/esm/config/settings/keyValueStore/types/CompositeCompositeKvsIndex.js +2 -0
- package/lib/esm/config/settings/keyValueStore/types/CompositeCompositeKvsIndex.js.map +1 -0
- package/lib/esm/config/settings/keyValueStore/types/CompositeKvsIndex.d.ts +2 -7
- package/lib/esm/config/settings/keyValueStore/types/CompositeKvsIndex.js.map +1 -1
- package/lib/esm/config/settings/keyValueStore/types/CompositeKvsKey.d.ts +4 -0
- package/lib/esm/config/settings/keyValueStore/types/CompositeKvsKey.js +2 -0
- package/lib/esm/config/settings/keyValueStore/types/CompositeKvsKey.js.map +1 -0
- package/lib/esm/config/settings/keyValueStore/types/index.d.ts +2 -0
- package/lib/esm/config/settings/keyValueStore/types/index.js +2 -0
- package/lib/esm/config/settings/keyValueStore/types/index.js.map +1 -1
- package/lib/esm/logic/config/getForeignItems.d.ts +3 -0
- package/lib/esm/logic/config/getForeignItems.js +7 -0
- package/lib/esm/logic/config/getForeignItems.js.map +1 -0
- package/lib/esm/logic/config/index.d.ts +1 -0
- package/lib/esm/logic/config/index.js +1 -0
- package/lib/esm/logic/config/index.js.map +1 -1
- package/lib/esm/logic/graphDatabase/GraphResultConverters.d.ts +11 -0
- package/lib/esm/logic/graphDatabase/GraphResultConverters.js +2 -0
- package/lib/esm/logic/graphDatabase/GraphResultConverters.js.map +1 -0
- package/lib/esm/logic/graphDatabase/createAnyGraphResultConverter.d.ts +1 -10
- package/lib/esm/logic/graphDatabase/createAnyGraphResultConverter.js.map +1 -1
- package/lib/esm/logic/graphDatabase/index.d.ts +1 -0
- package/lib/esm/logic/graphDatabase/index.js +1 -0
- package/lib/esm/logic/graphDatabase/index.js.map +1 -1
- package/lib/esm/qpqCoreUtils.d.ts +1 -1
- package/lib/esm/qpqCoreUtils.js +1 -1
- package/lib/esm/qpqCoreUtils.js.map +1 -1
- package/lib/esm/qpqCoreUtilsLib.d.ts +1 -0
- package/lib/esm/stories/paging/PagedDataDrainOptions.d.ts +6 -0
- package/lib/esm/stories/paging/PagedDataDrainOptions.js +2 -0
- package/lib/esm/stories/paging/PagedDataDrainOptions.js.map +1 -0
- package/lib/esm/stories/paging/askPagedDataDrain.d.ts +1 -4
- package/lib/esm/stories/paging/askPagedDataDrain.js.map +1 -1
- package/lib/esm/stories/paging/index.d.ts +1 -0
- package/lib/esm/stories/paging/index.js +1 -0
- package/lib/esm/stories/paging/index.js.map +1 -1
- package/lib/esm/stories/system/overrideActions/AskOverrideSlot.d.ts +2 -0
- package/lib/esm/stories/system/overrideActions/AskOverrideSlot.js +2 -0
- package/lib/esm/stories/system/overrideActions/AskOverrideSlot.js.map +1 -0
- package/lib/esm/stories/system/overrideActions/OverrideBatchSlot.d.ts +7 -0
- package/lib/esm/stories/system/overrideActions/OverrideBatchSlot.js +2 -0
- package/lib/esm/stories/system/overrideActions/OverrideBatchSlot.js.map +1 -0
- package/lib/esm/stories/system/overrideActions/askOverrideActions.d.ts +1 -1
- package/lib/esm/stories/system/overrideActions/askOverrideActions.js.map +1 -1
- package/lib/esm/stories/system/overrideActions/askOverrideBatch.d.ts +2 -2
- package/lib/esm/stories/system/overrideActions/askOverrideBatch.js +4 -16
- package/lib/esm/stories/system/overrideActions/askOverrideBatch.js.map +1 -1
- package/lib/esm/stories/system/overrideActions/askOverrideSlotRun.d.ts +11 -0
- package/lib/esm/stories/system/overrideActions/askOverrideSlotRun.js +20 -0
- package/lib/esm/stories/system/overrideActions/askOverrideSlotRun.js.map +1 -0
- package/lib/esm/stories/system/overrideActions/getOwnOverrideHandler.d.ts +2 -1
- package/lib/esm/stories/system/overrideActions/getOwnOverrideHandler.js.map +1 -1
- package/lib/esm/stories/system/overrideActions/index.d.ts +1 -0
- package/lib/esm/stories/system/overrideActions/index.js +1 -0
- package/lib/esm/stories/system/overrideActions/index.js.map +1 -1
- package/lib/esm/types/{ActionOverride.d.ts → ActionOverrideHandler.d.ts} +0 -3
- package/lib/esm/types/ActionOverrideHandler.js +2 -0
- package/lib/esm/types/ActionOverrideHandler.js.map +1 -0
- package/lib/esm/types/ActionOverrideMap.d.ts +4 -0
- package/lib/esm/types/ActionOverrideMap.js +2 -0
- package/lib/esm/types/ActionOverrideMap.js.map +1 -0
- package/lib/esm/types/authChallenge/CreateAuthChallengeEvent.d.ts +5 -0
- package/lib/esm/types/authChallenge/CreateAuthChallengeEvent.js.map +1 -1
- package/lib/esm/types/authChallenge/DefineAuthChallengeEvent.d.ts +5 -0
- package/lib/esm/types/authChallenge/DefineAuthChallengeEvent.js.map +1 -1
- package/lib/esm/types/index.d.ts +2 -1
- package/lib/esm/types/index.js +2 -1
- package/lib/esm/types/index.js.map +1 -1
- package/lib/esm/utils/functions/index.d.ts +1 -0
- package/lib/esm/utils/functions/index.js +1 -0
- package/lib/esm/utils/functions/index.js.map +1 -1
- package/lib/esm/utils/functions/sleep.d.ts +2 -0
- package/lib/esm/utils/functions/sleep.js +3 -0
- package/lib/esm/utils/functions/sleep.js.map +1 -0
- package/package.json +3 -3
- package/lib/commonjs/types/ActionOverride.js.map +0 -1
- package/lib/esm/types/ActionOverride.js +0 -2
- package/lib/esm/types/ActionOverride.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"askOverrideActions.js","sourceRoot":"","sources":["../../../../../src/stories/system/overrideActions/askOverrideActions.ts"],"names":[],"mappings":";;AAWA,gDAmCC;AA9CD,8CAAoD;AAGpD,yDAAsD;AACtD,yDAAsD;AACtD,mEAAgE;AAEhE,iGAAiG;AACjG,mGAAmG;AACnG,mGAAmG;AACnG,8CAA8C;AAC9C,QAAe,CAAC,CAAC,kBAAkB,CACjC,aAAgB,EAChB,SAA4B;IAE5B,IAAI,UAAU,GAAG,aAAa,CAAC,IAAI,EAAE,CAAC;IAEtC,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;QACxB,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC;QAEhC,8FAA8F;QAC9F,0DAA0D;QAC1D,MAAM,OAAO,GACX,IAAA,6CAAqB,EAAC,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,0BAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,IAAA,6CAAqB,EAAC,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QAEhJ,IAAI,OAAO,EAAE,CAAC;YACZ,6FAA6F;YAC7F,0FAA0F;YAC1F,yFAAyF;YACzF,6FAA6F;YAC7F,4DAA4D;YAC5D,UAAU,GAAG,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;YACxD,SAAS;QACX,CAAC;QAED,IAAI,MAAM,CAAC,IAAI,KAAK,0BAAgB,CAAC,KAAK,EAAE,CAAC;YAC3C,UAAU,GAAG,aAAa,CAAC,IAAI,CAC7B,KAAK,CAAC,CAAC,IAAA,mCAAgB,EAAC,MAAM,EAAE,SAAS,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,kBAAkB,CAAC,IAAA,mCAAgB,EAAC,WAAW,CAAC,EAAE,SAAS,CAAC,CAAC,CAC1H,CAAC;YACF,SAAS;QACX,CAAC;QAED,UAAU,GAAG,aAAa,CAAC,IAAI,CAAC,MAAM,MAAM,CAAC,CAAC;IAChD,CAAC;IAED,OAAO,UAAU,CAAC,KAAK,CAAC;AAC1B,CAAC","sourcesContent":["import { SystemActionType } from '../../../actions';\nimport { AskResponse, AskResponseReturnType } from '../../../types';\nimport { ActionOverrideMap } from '../../../types/
|
|
1
|
+
{"version":3,"file":"askOverrideActions.js","sourceRoot":"","sources":["../../../../../src/stories/system/overrideActions/askOverrideActions.ts"],"names":[],"mappings":";;AAWA,gDAmCC;AA9CD,8CAAoD;AAGpD,yDAAsD;AACtD,yDAAsD;AACtD,mEAAgE;AAEhE,iGAAiG;AACjG,mGAAmG;AACnG,mGAAmG;AACnG,8CAA8C;AAC9C,QAAe,CAAC,CAAC,kBAAkB,CACjC,aAAgB,EAChB,SAA4B;IAE5B,IAAI,UAAU,GAAG,aAAa,CAAC,IAAI,EAAE,CAAC;IAEtC,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;QACxB,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC;QAEhC,8FAA8F;QAC9F,0DAA0D;QAC1D,MAAM,OAAO,GACX,IAAA,6CAAqB,EAAC,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,0BAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,IAAA,6CAAqB,EAAC,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QAEhJ,IAAI,OAAO,EAAE,CAAC;YACZ,6FAA6F;YAC7F,0FAA0F;YAC1F,yFAAyF;YACzF,6FAA6F;YAC7F,4DAA4D;YAC5D,UAAU,GAAG,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;YACxD,SAAS;QACX,CAAC;QAED,IAAI,MAAM,CAAC,IAAI,KAAK,0BAAgB,CAAC,KAAK,EAAE,CAAC;YAC3C,UAAU,GAAG,aAAa,CAAC,IAAI,CAC7B,KAAK,CAAC,CAAC,IAAA,mCAAgB,EAAC,MAAM,EAAE,SAAS,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,kBAAkB,CAAC,IAAA,mCAAgB,EAAC,WAAW,CAAC,EAAE,SAAS,CAAC,CAAC,CAC1H,CAAC;YACF,SAAS;QACX,CAAC;QAED,UAAU,GAAG,aAAa,CAAC,IAAI,CAAC,MAAM,MAAM,CAAC,CAAC;IAChD,CAAC;IAED,OAAO,UAAU,CAAC,KAAK,CAAC;AAC1B,CAAC","sourcesContent":["import { SystemActionType } from '../../../actions';\nimport { AskResponse, AskResponseReturnType } from '../../../types';\nimport { ActionOverrideMap } from '../../../types/ActionOverrideMap';\nimport { askOverrideBatch } from './askOverrideBatch';\nimport { askProcessAction } from './askProcessAction';\nimport { getOwnOverrideHandler } from './getOwnOverrideHandler';\n\n// Sits between a story and the runtime, intercepting actions as the story yields them. An action\n// with an override (by type, or the \"*\" wildcard) runs the handler instead of the runtime; a batch\n// is cracked open by askOverrideBatch so overrides apply however deeply the batches nest; anything\n// else is yielded up to the parent untouched.\nexport function* askOverrideActions<T extends AskResponse<any>>(\n storyIterator: T,\n overrides: ActionOverrideMap,\n): AskResponse<AskResponseReturnType<T>> {\n let nextResult = storyIterator.next();\n\n while (!nextResult.done) {\n const action = nextResult.value;\n\n // The specific type takes priority over the wildcard. A batch is never handed to the wildcard\n // as a whole; its members are checked one by one instead.\n const handler =\n getOwnOverrideHandler(overrides, action.type) || (action.type !== SystemActionType.Batch ? getOwnOverrideHandler(overrides, '*') : undefined);\n\n if (handler) {\n // The handler's return value is fed to the story VERBATIM, never reshaped. That is what lets\n // a handler relay an action with a bare `return yield action`: what it gets back from the\n // parent (raw, or an EitherActionResult when the action carries returnErrors, e.g. under\n // askCatch) is already what the story expects. A handler that returns its OWN computed value\n // shapes it with getSuccessfulEitherActionResultIfRequired.\n nextResult = storyIterator.next(yield* handler(action));\n continue;\n }\n\n if (action.type === SystemActionType.Batch) {\n nextResult = storyIterator.next(\n yield* askOverrideBatch(action, overrides, (batchAction) => askOverrideActions(askProcessAction(batchAction), overrides)),\n );\n continue;\n }\n\n nextResult = storyIterator.next(yield action);\n }\n\n return nextResult.value;\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Action, AskResponse } from '../../../types';
|
|
2
|
-
import { ActionOverrideMap } from '../../../types/
|
|
3
|
-
|
|
2
|
+
import { ActionOverrideMap } from '../../../types/ActionOverrideMap';
|
|
3
|
+
import { AskOverrideSlot } from './AskOverrideSlot';
|
|
4
4
|
export declare function askOverrideBatch(action: Action<any>, overrides: ActionOverrideMap, askOverrideSlot: AskOverrideSlot): AskResponse<unknown>;
|
|
@@ -5,7 +5,7 @@ const actions_1 = require("../../../actions");
|
|
|
5
5
|
const actionResult_1 = require("../../../logic/actionResult");
|
|
6
6
|
const askMapParallel_1 = require("../../array/askMapParallel");
|
|
7
7
|
const askCatch_1 = require("../askCatch");
|
|
8
|
-
const
|
|
8
|
+
const askOverrideSlotRun_1 = require("./askOverrideSlotRun");
|
|
9
9
|
const getSuccessfulEitherActionResultIfRequired_1 = require("./getSuccessfulEitherActionResultIfRequired");
|
|
10
10
|
const isFailedSlotResult = (slotResult) => slotResult !== undefined && !slotResult.success;
|
|
11
11
|
// When stories run things in parallel (askRunParallel), the actions get bundled into a single batch
|
|
@@ -16,20 +16,8 @@ const isFailedSlotResult = (slotResult) => slotResult !== undefined && !slotResu
|
|
|
16
16
|
// failure comes back as the value, matching what the runtime would do.
|
|
17
17
|
function* askOverrideBatch(action, overrides, askOverrideSlot) {
|
|
18
18
|
const batchActionPayload = action.payload;
|
|
19
|
-
const batchActionsToRun = yield* (0, askMapParallel_1.askMapParallel)(batchActionPayload.actions, function*
|
|
20
|
-
|
|
21
|
-
const isBatch = batchAction.type === actions_1.SystemActionType.Batch;
|
|
22
|
-
const needsRecursion = isOverridden || isBatch;
|
|
23
|
-
return {
|
|
24
|
-
action: batchAction,
|
|
25
|
-
// Already processed here, so it must not be sent to the runtime again below.
|
|
26
|
-
alreadyProcessed: needsRecursion,
|
|
27
|
-
// The slot run is wrapped in askCatch so a failing sub-action becomes a captured failure for
|
|
28
|
-
// THIS slot instead of escaping bare and bypassing the enclosing batch's returnErrors
|
|
29
|
-
// protection. Every slot holds an EitherActionResult; the successful ones are unwrapped when
|
|
30
|
-
// the batch is reassembled.
|
|
31
|
-
result: needsRecursion ? yield* (0, askCatch_1.askCatch)(askOverrideSlot(batchAction)) : undefined,
|
|
32
|
-
};
|
|
19
|
+
const batchActionsToRun = yield* (0, askMapParallel_1.askMapParallel)(batchActionPayload.actions, function* (batchAction) {
|
|
20
|
+
return yield* (0, askOverrideSlotRun_1.askOverrideSlotRun)(batchAction, overrides, askOverrideSlot);
|
|
33
21
|
});
|
|
34
22
|
const remainingBatchActionsToRun = batchActionsToRun.filter((ba) => !ba.alreadyProcessed);
|
|
35
23
|
// askCatch so a failing runtime batch comes back as a value instead of killing everything.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"askOverrideBatch.js","sourceRoot":"","sources":["../../../../../src/stories/system/overrideActions/askOverrideBatch.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"askOverrideBatch.js","sourceRoot":"","sources":["../../../../../src/stories/system/overrideActions/askOverrideBatch.ts"],"names":[],"mappings":";;AAmBA,4CAiCC;AApDD,8CAAqF;AACrF,8DAA8E;AAG9E,+DAA4D;AAC5D,0CAAuC;AAEvC,6DAA0D;AAC1D,2GAAwG;AAExG,MAAM,kBAAkB,GAAG,CAAC,UAA+C,EAA8D,EAAE,CACzI,UAAU,KAAK,SAAS,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;AAElD,oGAAoG;AACpG,oGAAoG;AACpG,qGAAqG;AACrG,kGAAkG;AAClG,oGAAoG;AACpG,uEAAuE;AACvE,QAAe,CAAC,CAAC,gBAAgB,CAAC,MAAmB,EAAE,SAA4B,EAAE,eAAgC;IACnH,MAAM,kBAAkB,GAA6B,MAAM,CAAC,OAAO,CAAC;IAEpE,MAAM,iBAAiB,GAAG,KAAK,CAAC,CAAC,IAAA,+BAAc,EAAC,kBAAkB,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE,WAAW;QAChG,OAAO,KAAK,CAAC,CAAC,IAAA,uCAAkB,EAAC,WAAW,EAAE,SAAS,EAAE,eAAe,CAAC,CAAC;IAC5E,CAAC,CAAC,CAAC;IAEH,MAAM,0BAA0B,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC;IAE1F,2FAA2F;IAC3F,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,IAAA,mBAAQ,EAAC,IAAA,kBAAQ,EAAC,0BAA0B,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAE7F,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;QACpB,0BAA0B,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE;YAC/C,EAAE,CAAC,MAAM,GAAG,IAAA,8CAA+B,EAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACrE,CAAC,CAAC,CAAC;IACL,CAAC;IAED,uFAAuF;IACvF,oFAAoF;IACpF,MAAM,YAAY,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IAEpH,IAAI,YAAY,EAAE,CAAC;QACjB,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;YACzB,OAAO,KAAK,CAAC,CAAC,IAAA,uBAAa,EAAC,YAAY,CAAC,KAAK,CAAC,SAAS,EAAE,YAAY,CAAC,KAAK,CAAC,SAAS,EAAE,YAAY,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACzH,CAAC;QAED,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,MAAM,UAAU,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,WAAC,OAAA,MAAA,EAAE,CAAC,MAAM,0CAAE,MAAM,CAAA,EAAA,CAAC,CAAC;IAEpE,OAAO,IAAA,qFAAyC,EAAC,UAAU,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;AACpF,CAAC","sourcesContent":["import { askBatch, askThrowError, SystemBatchActionPayload } from '../../../actions';\nimport { getSuccessfulEitherActionResult } from '../../../logic/actionResult';\nimport { Action, AskResponse, EitherActionResult } from '../../../types';\nimport { ActionOverrideMap } from '../../../types/ActionOverrideMap';\nimport { askMapParallel } from '../../array/askMapParallel';\nimport { askCatch } from '../askCatch';\nimport { AskOverrideSlot } from './AskOverrideSlot';\nimport { askOverrideSlotRun } from './askOverrideSlotRun';\nimport { getSuccessfulEitherActionResultIfRequired } from './getSuccessfulEitherActionResultIfRequired';\n\nconst isFailedSlotResult = (slotResult: EitherActionResult<any> | undefined): slotResult is EitherActionResult<any> & { success: false } =>\n slotResult !== undefined && !slotResult.success;\n\n// When stories run things in parallel (askRunParallel), the actions get bundled into a single batch\n// action. This cracks the batch open, runs every overridden slot (and every nested batch, which may\n// hold overridden actions deeper inside) through `askOverrideSlot`, sends the rest to the runtime as\n// a smaller batch, and reassembles the results in the original order. Returns the value the story\n// should be resumed with; a failure throws unless the batch carries returnErrors, in which case the\n// failure comes back as the value, matching what the runtime would do.\nexport function* askOverrideBatch(action: Action<any>, overrides: ActionOverrideMap, askOverrideSlot: AskOverrideSlot): AskResponse<unknown> {\n const batchActionPayload: SystemBatchActionPayload = action.payload;\n\n const batchActionsToRun = yield* askMapParallel(batchActionPayload.actions, function* (batchAction) {\n return yield* askOverrideSlotRun(batchAction, overrides, askOverrideSlot);\n });\n\n const remainingBatchActionsToRun = batchActionsToRun.filter((ba) => !ba.alreadyProcessed);\n\n // askCatch so a failing runtime batch comes back as a value instead of killing everything.\n const results = yield* askCatch(askBatch(remainingBatchActionsToRun.map((ba) => ba.action)));\n\n if (results.success) {\n remainingBatchActionsToRun.forEach((ba, index) => {\n ba.result = getSuccessfulEitherActionResult(results.result[index]);\n });\n }\n\n // One failure fails the whole batch, matching the runtime's batch semantics: a runtime\n // batch failure wins, otherwise the first captured failure from an overridden slot.\n const failedResult = !results.success ? results : batchActionsToRun.map((ba) => ba.result).find(isFailedSlotResult);\n\n if (failedResult) {\n if (!action.returnErrors) {\n return yield* askThrowError(failedResult.error.errorType, failedResult.error.errorText, failedResult.error.errorStack);\n }\n\n return failedResult;\n }\n\n const allResults = batchActionsToRun.map((ba) => ba.result?.result);\n\n return getSuccessfulEitherActionResultIfRequired(allResults, action.returnErrors);\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Action, AskResponse } from '../../../types';
|
|
2
|
+
import { ActionOverrideMap } from '../../../types/ActionOverrideMap';
|
|
3
|
+
import { AskOverrideSlot } from './AskOverrideSlot';
|
|
4
|
+
import { OverrideBatchSlot } from './OverrideBatchSlot';
|
|
5
|
+
/**
|
|
6
|
+
* Runs one batch slot here when an override claims it, or when it is itself a batch that may hold overridden
|
|
7
|
+
* actions deeper inside; any other slot is left for the runtime batch. The run is wrapped in askCatch so a failing
|
|
8
|
+
* sub-action becomes a captured failure for this slot instead of escaping bare and bypassing the enclosing batch's
|
|
9
|
+
* returnErrors protection.
|
|
10
|
+
*/
|
|
11
|
+
export declare function askOverrideSlotRun(batchAction: Action<any>, overrides: ActionOverrideMap, askOverrideSlot: AskOverrideSlot): AskResponse<OverrideBatchSlot>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.askOverrideSlotRun = askOverrideSlotRun;
|
|
4
|
+
const actions_1 = require("../../../actions");
|
|
5
|
+
const askCatch_1 = require("../askCatch");
|
|
6
|
+
const getOwnOverrideHandler_1 = require("./getOwnOverrideHandler");
|
|
7
|
+
/**
|
|
8
|
+
* Runs one batch slot here when an override claims it, or when it is itself a batch that may hold overridden
|
|
9
|
+
* actions deeper inside; any other slot is left for the runtime batch. The run is wrapped in askCatch so a failing
|
|
10
|
+
* sub-action becomes a captured failure for this slot instead of escaping bare and bypassing the enclosing batch's
|
|
11
|
+
* returnErrors protection.
|
|
12
|
+
*/
|
|
13
|
+
function* askOverrideSlotRun(batchAction, overrides, askOverrideSlot) {
|
|
14
|
+
const isOverridden = !!((0, getOwnOverrideHandler_1.getOwnOverrideHandler)(overrides, batchAction.type) || (0, getOwnOverrideHandler_1.getOwnOverrideHandler)(overrides, '*'));
|
|
15
|
+
const isBatch = batchAction.type === actions_1.SystemActionType.Batch;
|
|
16
|
+
const needsRecursion = isOverridden || isBatch;
|
|
17
|
+
return {
|
|
18
|
+
action: batchAction,
|
|
19
|
+
alreadyProcessed: needsRecursion,
|
|
20
|
+
result: needsRecursion ? yield* (0, askCatch_1.askCatch)(askOverrideSlot(batchAction)) : undefined,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=askOverrideSlotRun.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"askOverrideSlotRun.js","sourceRoot":"","sources":["../../../../../src/stories/system/overrideActions/askOverrideSlotRun.ts"],"names":[],"mappings":";;AAcA,gDAcC;AA5BD,8CAAoD;AAGpD,0CAAuC;AAEvC,mEAAgE;AAGhE;;;;;GAKG;AACH,QAAe,CAAC,CAAC,kBAAkB,CACjC,WAAwB,EACxB,SAA4B,EAC5B,eAAgC;IAEhC,MAAM,YAAY,GAAG,CAAC,CAAC,CAAC,IAAA,6CAAqB,EAAC,SAAS,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,IAAA,6CAAqB,EAAC,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC;IACrH,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,KAAK,0BAAgB,CAAC,KAAK,CAAC;IAC5D,MAAM,cAAc,GAAG,YAAY,IAAI,OAAO,CAAC;IAE/C,OAAO;QACL,MAAM,EAAE,WAAW;QACnB,gBAAgB,EAAE,cAAc;QAChC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAA,mBAAQ,EAAC,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;KACnF,CAAC;AACJ,CAAC","sourcesContent":["import { SystemActionType } from '../../../actions';\nimport { Action, AskResponse } from '../../../types';\nimport { ActionOverrideMap } from '../../../types/ActionOverrideMap';\nimport { askCatch } from '../askCatch';\nimport { AskOverrideSlot } from './AskOverrideSlot';\nimport { getOwnOverrideHandler } from './getOwnOverrideHandler';\nimport { OverrideBatchSlot } from './OverrideBatchSlot';\n\n/**\n * Runs one batch slot here when an override claims it, or when it is itself a batch that may hold overridden\n * actions deeper inside; any other slot is left for the runtime batch. The run is wrapped in askCatch so a failing\n * sub-action becomes a captured failure for this slot instead of escaping bare and bypassing the enclosing batch's\n * returnErrors protection.\n */\nexport function* askOverrideSlotRun(\n batchAction: Action<any>,\n overrides: ActionOverrideMap,\n askOverrideSlot: AskOverrideSlot,\n): AskResponse<OverrideBatchSlot> {\n const isOverridden = !!(getOwnOverrideHandler(overrides, batchAction.type) || getOwnOverrideHandler(overrides, '*'));\n const isBatch = batchAction.type === SystemActionType.Batch;\n const needsRecursion = isOverridden || isBatch;\n\n return {\n action: batchAction,\n alreadyProcessed: needsRecursion,\n result: needsRecursion ? yield* askCatch(askOverrideSlot(batchAction)) : undefined,\n };\n}\n"]}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { ActionOverrideHandler
|
|
1
|
+
import { ActionOverrideHandler } from '../../../types/ActionOverrideHandler';
|
|
2
|
+
import { ActionOverrideMap } from '../../../types/ActionOverrideMap';
|
|
2
3
|
export declare const getOwnOverrideHandler: (overrides: ActionOverrideMap, actionType: string) => ActionOverrideHandler | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getOwnOverrideHandler.js","sourceRoot":"","sources":["../../../../../src/stories/system/overrideActions/getOwnOverrideHandler.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"getOwnOverrideHandler.js","sourceRoot":"","sources":["../../../../../src/stories/system/overrideActions/getOwnOverrideHandler.ts"],"names":[],"mappings":";;;AAGA,8FAA8F;AAC9F,+FAA+F;AAC/F,yDAAyD;AAClD,MAAM,qBAAqB,GAAG,CAAC,SAA4B,EAAE,UAAkB,EAAqC,EAAE,CAC3H,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AADrF,QAAA,qBAAqB,yBACgE","sourcesContent":["import { ActionOverrideHandler } from '../../../types/ActionOverrideHandler';\nimport { ActionOverrideMap } from '../../../types/ActionOverrideMap';\n\n// Looks up a handler as an OWN property of the override map. A plain-object map inherits from\n// Object.prototype, so an action type like \"toString\" or \"constructor\" would otherwise resolve\n// to an inherited function and get invoked as a handler.\nexport const getOwnOverrideHandler = (overrides: ActionOverrideMap, actionType: string): ActionOverrideHandler | undefined =>\n Object.prototype.hasOwnProperty.call(overrides, actionType) ? overrides[actionType] : undefined;\n"]}
|
|
@@ -16,5 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./askOverrideActions"), exports);
|
|
18
18
|
__exportStar(require("./askOverrideBatch"), exports);
|
|
19
|
+
__exportStar(require("./AskOverrideSlot"), exports);
|
|
19
20
|
__exportStar(require("./getSuccessfulEitherActionResultIfRequired"), exports);
|
|
20
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/stories/system/overrideActions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,qDAAmC;AACnC,8EAA4D","sourcesContent":["export * from './askOverrideActions';\nexport * from './askOverrideBatch';\nexport * from './getSuccessfulEitherActionResultIfRequired';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/stories/system/overrideActions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,qDAAmC;AACnC,oDAAkC;AAClC,8EAA4D","sourcesContent":["export * from './askOverrideActions';\nexport * from './askOverrideBatch';\nexport * from './AskOverrideSlot';\nexport * from './getSuccessfulEitherActionResultIfRequired';\n"]}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import { Action } from './Action';
|
|
2
2
|
import { AskResponse } from './StorySession';
|
|
3
3
|
export type ActionOverrideHandler<TAction extends Action<any> = Action<any>, TResult = any> = (action: TAction) => AskResponse<TResult>;
|
|
4
|
-
export type ActionOverrideMap = {
|
|
5
|
-
[actionType: string]: ActionOverrideHandler<any, any>;
|
|
6
|
-
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionOverrideHandler.js","sourceRoot":"","sources":["../../../src/types/ActionOverrideHandler.ts"],"names":[],"mappings":"","sourcesContent":["import { Action } from './Action';\nimport { AskResponse } from './StorySession';\n\n// A function that takes an action and returns a story (generator) that produces the override result.\n// This is what the user provides for each action type they want to intercept.\nexport type ActionOverrideHandler<TAction extends Action<any> = Action<any>, TResult = any> = (action: TAction) => AskResponse<TResult>;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionOverrideMap.js","sourceRoot":"","sources":["../../../src/types/ActionOverrideMap.ts"],"names":[],"mappings":"","sourcesContent":["import { ActionOverrideHandler } from './ActionOverrideHandler';\n\n// A map of action type strings to their override handlers.\n// The key is the action type (e.g. \"MathActionType.RandomNumber\") or \"*\" for a wildcard catch-all.\n// The value is the handler function that will run instead of the normal action processor.\nexport type ActionOverrideMap = {\n [actionType: string]: ActionOverrideHandler<any, any>;\n};\n"]}
|
|
@@ -4,6 +4,11 @@ export type CreateAuthChallengeEvent = {
|
|
|
4
4
|
userName: string;
|
|
5
5
|
session: ChallengeSession;
|
|
6
6
|
userAttributes: UserAttributes;
|
|
7
|
+
/**
|
|
8
|
+
* true when the directory has no such user. With user existence errors suppressed the trigger still runs for an
|
|
9
|
+
* unknown account, and the story must answer exactly as it would for a real one so the two cannot be told apart.
|
|
10
|
+
*/
|
|
11
|
+
userNotFound?: boolean;
|
|
7
12
|
};
|
|
8
13
|
/**
|
|
9
14
|
* Represents the response for creating an authentication challenge.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateAuthChallengeEvent.js","sourceRoot":"","sources":["../../../../src/types/authChallenge/CreateAuthChallengeEvent.ts"],"names":[],"mappings":"","sourcesContent":["import { UserAttributes } from '../../actions';\nimport { ChallengeSession } from './types';\n\nexport type CreateAuthChallengeEvent = {\n userName: string;\n session: ChallengeSession;\n userAttributes: UserAttributes;\n};\n\n/**\n * Represents the response for creating an authentication challenge.\n */\nexport type CreateAuthChallengeEventResponse = {\n /**\n * The name of the custom challenge\n */\n challengeName?: string;\n\n /**\n * Key-value pairs for the client app to use when presenting the challenge to the user.\n * This parameter should contain all necessary information to accurately present the challenge.\n */\n publicChallengeParameters?: Record<string, string>;\n\n /**\n * Key-value pairs containing the information required to validate the user's response to the challenge.\n * Typically, this contains the correct answers or validation criteria for the challenge.\n */\n privateChallengeParameters?: Record<string, string>;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"CreateAuthChallengeEvent.js","sourceRoot":"","sources":["../../../../src/types/authChallenge/CreateAuthChallengeEvent.ts"],"names":[],"mappings":"","sourcesContent":["import { UserAttributes } from '../../actions';\nimport { ChallengeSession } from './types';\n\nexport type CreateAuthChallengeEvent = {\n userName: string;\n session: ChallengeSession;\n userAttributes: UserAttributes;\n /**\n * true when the directory has no such user. With user existence errors suppressed the trigger still runs for an\n * unknown account, and the story must answer exactly as it would for a real one so the two cannot be told apart.\n */\n userNotFound?: boolean;\n};\n\n/**\n * Represents the response for creating an authentication challenge.\n */\nexport type CreateAuthChallengeEventResponse = {\n /**\n * The name of the custom challenge\n */\n challengeName?: string;\n\n /**\n * Key-value pairs for the client app to use when presenting the challenge to the user.\n * This parameter should contain all necessary information to accurately present the challenge.\n */\n publicChallengeParameters?: Record<string, string>;\n\n /**\n * Key-value pairs containing the information required to validate the user's response to the challenge.\n * Typically, this contains the correct answers or validation criteria for the challenge.\n */\n privateChallengeParameters?: Record<string, string>;\n};\n"]}
|
|
@@ -4,6 +4,11 @@ export type DefineAuthChallengeEvent = {
|
|
|
4
4
|
userName: string;
|
|
5
5
|
session: ChallengeSession;
|
|
6
6
|
userAttributes: UserAttributes;
|
|
7
|
+
/**
|
|
8
|
+
* true when the directory has no such user. With user existence errors suppressed the trigger still runs for an
|
|
9
|
+
* unknown account, and the story must answer exactly as it would for a real one so the two cannot be told apart.
|
|
10
|
+
*/
|
|
11
|
+
userNotFound?: boolean;
|
|
7
12
|
};
|
|
8
13
|
export type DefineAuthChallengeEventResponse = {
|
|
9
14
|
runCreateAuthChallenge: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefineAuthChallengeEvent.js","sourceRoot":"","sources":["../../../../src/types/authChallenge/DefineAuthChallengeEvent.ts"],"names":[],"mappings":"","sourcesContent":["import { UserAttributes } from '../../actions';\nimport { ChallengeSession } from './types';\n\nexport type DefineAuthChallengeEvent = {\n userName: string;\n session: ChallengeSession;\n userAttributes: UserAttributes;\n};\n\nexport type DefineAuthChallengeEventResponse = {\n runCreateAuthChallenge: boolean;\n failAuthentication: boolean;\n issueTokens: boolean;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"DefineAuthChallengeEvent.js","sourceRoot":"","sources":["../../../../src/types/authChallenge/DefineAuthChallengeEvent.ts"],"names":[],"mappings":"","sourcesContent":["import { UserAttributes } from '../../actions';\nimport { ChallengeSession } from './types';\n\nexport type DefineAuthChallengeEvent = {\n userName: string;\n session: ChallengeSession;\n userAttributes: UserAttributes;\n /**\n * true when the directory has no such user. With user existence errors suppressed the trigger still runs for an\n * unknown account, and the story must answer exactly as it would for a real one so the two cannot be told apart.\n */\n userNotFound?: boolean;\n};\n\nexport type DefineAuthChallengeEventResponse = {\n runCreateAuthChallenge: boolean;\n failAuthentication: boolean;\n issueTokens: boolean;\n};\n"]}
|
|
@@ -15,7 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./Action"), exports);
|
|
18
|
-
__exportStar(require("./
|
|
18
|
+
__exportStar(require("./ActionOverrideHandler"), exports);
|
|
19
|
+
__exportStar(require("./ActionOverrideMap"), exports);
|
|
19
20
|
__exportStar(require("./ActionRequesterFunction"), exports);
|
|
20
21
|
__exportStar(require("./authChallenge"), exports);
|
|
21
22
|
__exportStar(require("./BoundLogicStory"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,0DAAwC;AACxC,sDAAoC;AACpC,4DAA0C;AAC1C,kDAAgC;AAChC,oDAAkC;AAClC,0CAAwB;AACxB,wDAAsC;AACtC,uDAAqC;AACrC,qDAAmC;AACnC,6DAA2C;AAC3C,qDAAmC;AACnC,gDAA8B;AAC9B,wDAAsC;AACtC,kDAAgC;AAChC,iDAA+B;AAC/B,gDAA8B;AAC9B,2DAAyC;AACzC,0CAAwB;AACxB,mDAAiC;AACjC,iDAA+B;AAC/B,2CAAyB;AACzB,0DAAwC;AACxC,6CAA2B;AAC3B,2DAAyC;AACzC,kDAAgC;AAChC,yDAAuC;AACvC,sDAAoC;AACpC,uDAAqC;AACrC,mDAAiC;AACjC,8CAA4B;AAC5B,iDAA+B;AAC/B,oDAAkC;AAClC,+CAA6B;AAC7B,gDAA8B;AAC9B,mDAAiC;AACjC,iDAA+B;AAC/B,mDAAiC;AACjC,iDAA+B;AAC/B,sDAAoC;AACpC,wDAAsC","sourcesContent":["export * from './Action';\nexport * from './ActionOverrideHandler';\nexport * from './ActionOverrideMap';\nexport * from './ActionRequesterFunction';\nexport * from './authChallenge';\nexport * from './BoundLogicStory';\nexport * from './Brand';\nexport * from './ConfigUrlDefinition';\nexport * from './CrossModuleMessage';\nexport * from './CrossModuleOwner';\nexport * from './CrossServiceResourceName';\nexport * from './DecomposedString';\nexport * from './DeployEvent';\nexport * from './DynamicModuleLoader';\nexport * from './ErrorTypeEnum';\nexport * from './EventMessage';\nexport * from './ExcludeKeys';\nexport * from './FullyQualifiedResource';\nexport * from './KeyOf';\nexport * from './KvsStreamEvent';\nexport * from './LogLevelEnum';\nexport * from './Lookup';\nexport * from './NotifyErrorQueueEvent';\nexport * from './Nullable';\nexport * from './OwnerDeploymentContext';\nexport * from './QPQBinaryData';\nexport * from './QpqContextIdentifier';\nexport * from './QpqExecutionTrace';\nexport * from './QpqFunctionRuntime';\nexport * from './QpqIsoDateTime';\nexport * from './QpqLogger';\nexport * from './QpqPagedData';\nexport * from './QpqPureFunction';\nexport * from './QueueEvent';\nexport * from './Readonlyify';\nexport * from './ScheduledEvent';\nexport * from './StorySession';\nexport * from './StreamRegistry';\nexport * from './TextFileType';\nexport * from './UnboundLogicStory';\nexport * from './UnionToIntersection';\n"]}
|
|
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./bindApi"), exports);
|
|
18
18
|
__exportStar(require("./bindApiFunction"), exports);
|
|
19
|
+
__exportStar(require("./sleep"), exports);
|
|
19
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utils/functions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,oDAAkC","sourcesContent":["export * from './bindApi';\nexport * from './bindApiFunction';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utils/functions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,oDAAkC;AAClC,0CAAwB","sourcesContent":["export * from './bindApi';\nexport * from './bindApiFunction';\nexport * from './sleep';\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sleep = void 0;
|
|
4
|
+
/** Resolves after `ms` milliseconds; the one promise-based wait for retries, backoff and dev delays. */
|
|
5
|
+
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
6
|
+
exports.sleep = sleep;
|
|
7
|
+
//# sourceMappingURL=sleep.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sleep.js","sourceRoot":"","sources":["../../../../src/utils/functions/sleep.ts"],"names":[],"mappings":";;;AAAA,wGAAwG;AACjG,MAAM,KAAK,GAAG,CAAC,EAAU,EAAiB,EAAE,CAAC,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAA/F,QAAA,KAAK,SAA0F","sourcesContent":["/** Resolves after `ms` milliseconds; the one promise-based wait for retries, backoff and dev delays. */\nexport const sleep = (ms: number): Promise<void> => new Promise<void>((resolve) => setTimeout(resolve, ms));\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CompositeKvsKey } from './types/
|
|
1
|
+
import { CompositeKvsKey } from './types/CompositeKvsKey';
|
|
2
2
|
import { KeyValueStoreQPQConfigSetting } from './types/KeyValueStoreQPQConfigSetting';
|
|
3
3
|
import { QPQConfigAdvancedKeyValueStoreSettings } from './types/QPQConfigAdvancedKeyValueStoreSettings';
|
|
4
4
|
export declare const defineKeyValueStore: <T extends object = any>(keyValueStoreName: string, partitionKey: CompositeKvsKey<T>, sortKeys?: CompositeKvsKey<T>[], options?: QPQConfigAdvancedKeyValueStoreSettings<T>) => KeyValueStoreQPQConfigSetting<T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineKeyValueStore.js","sourceRoot":"","sources":["../../../../../src/config/settings/keyValueStore/defineKeyValueStore.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"defineKeyValueStore.js","sourceRoot":"","sources":["../../../../../src/config/settings/keyValueStore/defineKeyValueStore.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAQ3D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,kFAAkF;AAClF,kFAAkF;AAClF,kFAAkF;AAClF,gFAAgF;AAChF,qEAAqE;AAErE,MAAM,8BAA8B,GAAG,CAAyB,eAAmC,EAAa,EAAE;IAChH,oBAAoB;IACpB,IAAI,OAAO,eAAe,KAAK,QAAQ,EAAE,CAAC;QACxC,OAAO,MAAM,CAAI,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,MAAM,CAAI,iBAAiB,EAAE,QAAQ,CAAC;SACrD,CAAC;IACJ,CAAC;IAED,MAAM,YAAY,GAAG,8BAA8B,CAAI,iBAAiB,CAAC,YAAY,CAAC,CAAC;IAEvF,OAAO;QACL,IAAI,EAAE,iBAAiB,CAAC,IAAI,IAAI,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;AAEF,MAAM,CAAC,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,OAAO,EAAE,OAAO,IAAI,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,OAAO,EAAE,MAAM,IAAI,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,wBAAwB,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,OAAO,EAAE,MAAM,IAAI,KAAK;QAEhC,KAAK,EAAE,OAAO,EAAE,KAAK;QAErB,YAAY,EAAE,OAAO,EAAE,YAAY;QAEnC,0BAA0B,EAAE,OAAO,EAAE,0BAA0B,IAAI,KAAK;QAExE,aAAa,EAAE,OAAO,EAAE,aAAa;QACrC,MAAM,EAAE,OAAO,EAAE,MAAM,IAAI,KAAK;QAEhC,QAAQ,EAAE,OAAO,EAAE,QAAQ;KAC5B,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { KeyOf } from '../../../types';\nimport { QPQCoreConfigSettingType } from '../../QPQConfig';\nimport { CompositeCompositeKvsIndex } from './types/CompositeCompositeKvsIndex';\nimport { CompositeKvsIndex } from './types/CompositeKvsIndex';\nimport { CompositeKvsKey } from './types/CompositeKvsKey';\nimport { KeyValueStoreQPQConfigSetting } from './types/KeyValueStoreQPQConfigSetting';\nimport { KvsIndex } from './types/KvsIndex';\nimport { KvsKey } from './types/KvsKey';\nimport { QPQConfigAdvancedKeyValueStoreSettings } from './types/QPQConfigAdvancedKeyValueStoreSettings';\nimport { kvsKey } from './kvsKey';\n\n// TODO: @joe-coady: 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\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\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,7 @@
|
|
|
1
|
+
import { CompositeKvsKey } from './CompositeKvsKey';
|
|
2
|
+
/** An index written out in full, with each key given as a bare attribute name or in full. */
|
|
3
|
+
export type CompositeCompositeKvsIndex<T extends object = any> = {
|
|
4
|
+
name?: string;
|
|
5
|
+
partitionKey: CompositeKvsKey<T>;
|
|
6
|
+
sortKey?: CompositeKvsKey<T>;
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompositeCompositeKvsIndex.js","sourceRoot":"","sources":["../../../../../../src/config/settings/keyValueStore/types/CompositeCompositeKvsIndex.ts"],"names":[],"mappings":"","sourcesContent":["import { CompositeKvsKey } from './CompositeKvsKey';\n\n/** An index written out in full, with each key given as a bare attribute name or in full. */\nexport type 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"]}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import { KeyOf } from '../../../../types';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export type CompositeCompositeKvsIndex<T extends object = any> = {
|
|
5
|
-
name?: string;
|
|
6
|
-
partitionKey: CompositeKvsKey<T>;
|
|
7
|
-
sortKey?: CompositeKvsKey<T>;
|
|
8
|
-
};
|
|
2
|
+
import { CompositeCompositeKvsIndex } from './CompositeCompositeKvsIndex';
|
|
3
|
+
/** An index given either as a bare partition key attribute name or in full. */
|
|
9
4
|
export type CompositeKvsIndex<T extends object = any> = KeyOf<T> | CompositeCompositeKvsIndex<T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompositeKvsIndex.js","sourceRoot":"","sources":["../../../../../../src/config/settings/keyValueStore/types/CompositeKvsIndex.ts"],"names":[],"mappings":"","sourcesContent":["import { KeyOf } from '../../../../types';\nimport {
|
|
1
|
+
{"version":3,"file":"CompositeKvsIndex.js","sourceRoot":"","sources":["../../../../../../src/config/settings/keyValueStore/types/CompositeKvsIndex.ts"],"names":[],"mappings":"","sourcesContent":["import { KeyOf } from '../../../../types';\nimport { CompositeCompositeKvsIndex } from './CompositeCompositeKvsIndex';\n\n/** An index given either as a bare partition key attribute name or in full. */\nexport type CompositeKvsIndex<T extends object = any> = KeyOf<T> | CompositeCompositeKvsIndex<T>;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompositeKvsKey.js","sourceRoot":"","sources":["../../../../../../src/config/settings/keyValueStore/types/CompositeKvsKey.ts"],"names":[],"mappings":"","sourcesContent":["import { KeyOf } from '../../../../types';\nimport { KvsKey } from './KvsKey';\n\n/** A key given either as a bare attribute name (a string key) or in full. */\nexport type CompositeKvsKey<T extends object = any> = KvsKey<T> | KeyOf<T>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/config/settings/keyValueStore/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,0CAA0C,CAAC","sourcesContent":["export * from './CompositeKvsIndex';\nexport * from './KeyValueStoreQPQConfigSetting';\nexport * from './KvsIndex';\nexport * from './KvsKey';\nexport * from './KvsStreamSettings';\nexport * from './QPQConfigAdvancedKeyValueStoreSettings';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/config/settings/keyValueStore/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iCAAiC,CAAC;AAChD,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,0CAA0C,CAAC","sourcesContent":["export * from './CompositeCompositeKvsIndex';\nexport * from './CompositeKvsIndex';\nexport * from './CompositeKvsKey';\nexport * from './KeyValueStoreQPQConfigSetting';\nexport * from './KvsIndex';\nexport * from './KvsKey';\nexport * from './KvsStreamSettings';\nexport * from './QPQConfigAdvancedKeyValueStoreSettings';\n"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { QPQConfig, QPQConfigSetting } from '../../config/QPQConfig';
|
|
2
|
+
/** The settings another service owns (declared here with a cross-module owner): the inverse of getOwnedItems. */
|
|
3
|
+
export declare const getForeignItems: <T extends QPQConfigSetting>(settings: T[], qpqConfig: QPQConfig) => T[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { getOwnedItems } from './getOwnedItems';
|
|
2
|
+
/** The settings another service owns (declared here with a cross-module owner): the inverse of getOwnedItems. */
|
|
3
|
+
export const getForeignItems = (settings, qpqConfig) => {
|
|
4
|
+
const owned = getOwnedItems(settings, qpqConfig);
|
|
5
|
+
return settings.filter((setting) => !owned.includes(setting));
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=getForeignItems.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getForeignItems.js","sourceRoot":"","sources":["../../../../src/logic/config/getForeignItems.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,iHAAiH;AACjH,MAAM,CAAC,MAAM,eAAe,GAAG,CAA6B,QAAa,EAAE,SAAoB,EAAO,EAAE;IACtG,MAAM,KAAK,GAAG,aAAa,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IAEjD,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;AAChE,CAAC,CAAC","sourcesContent":["import { QPQConfig, QPQConfigSetting } from '../../config/QPQConfig';\nimport { getOwnedItems } from './getOwnedItems';\n\n/** The settings another service owns (declared here with a cross-module owner): the inverse of getOwnedItems. */\nexport const getForeignItems = <T extends QPQConfigSetting>(settings: T[], qpqConfig: QPQConfig): T[] => {\n const owned = getOwnedItems(settings, qpqConfig);\n\n return settings.filter((setting) => !owned.includes(setting));\n};\n"]}
|
|
@@ -7,6 +7,7 @@ export * from './getApplicationModuleName';
|
|
|
7
7
|
export * from './getApplicationName';
|
|
8
8
|
export * from './getConfigSetting';
|
|
9
9
|
export * from './getConfigSettings';
|
|
10
|
+
export * from './getForeignItems';
|
|
10
11
|
export * from './getOwnedItems';
|
|
11
12
|
export * from './resolveOwnedResourceLocalName';
|
|
12
13
|
export * from './resolveOwnerDeploymentContext';
|
|
@@ -7,6 +7,7 @@ export * from './getApplicationModuleName';
|
|
|
7
7
|
export * from './getApplicationName';
|
|
8
8
|
export * from './getConfigSetting';
|
|
9
9
|
export * from './getConfigSettings';
|
|
10
|
+
export * from './getForeignItems';
|
|
10
11
|
export * from './getOwnedItems';
|
|
11
12
|
export * from './resolveOwnedResourceLocalName';
|
|
12
13
|
export * from './resolveOwnerDeploymentContext';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/logic/config/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC","sourcesContent":["export * from './DEFAULT_ENVIRONMENT';\nexport * from './flattenQpqConfig';\nexport * from './getApplicationConfigSetting';\nexport * from './getApplicationModuleEnvironment';\nexport * from './getApplicationModuleFeature';\nexport * from './getApplicationModuleName';\nexport * from './getApplicationName';\nexport * from './getConfigSetting';\nexport * from './getConfigSettings';\nexport * from './getOwnedItems';\nexport * from './resolveOwnedResourceLocalName';\nexport * from './resolveOwnerDeploymentContext';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/logic/config/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC","sourcesContent":["export * from './DEFAULT_ENVIRONMENT';\nexport * from './flattenQpqConfig';\nexport * from './getApplicationConfigSetting';\nexport * from './getApplicationModuleEnvironment';\nexport * from './getApplicationModuleFeature';\nexport * from './getApplicationModuleName';\nexport * from './getApplicationName';\nexport * from './getConfigSetting';\nexport * from './getConfigSettings';\nexport * from './getForeignItems';\nexport * from './getOwnedItems';\nexport * from './resolveOwnedResourceLocalName';\nexport * from './resolveOwnerDeploymentContext';\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { GraphNodeResult } from '../../config/settings/graphDatabase/types/GraphNodeResult';
|
|
2
|
+
import { GraphRelationshipResult } from '../../config/settings/graphDatabase/types/GraphRelationshipResult';
|
|
3
|
+
import { AskResponse } from '../../types/StorySession';
|
|
4
|
+
/** What a vendor supplies to turn its own result cells into the platform-neutral graph results. */
|
|
5
|
+
export type GraphResultConverters<TResult, TNode extends TResult, TRelationship extends TResult> = {
|
|
6
|
+
vendor: string;
|
|
7
|
+
isNode: (result: TResult) => result is TNode;
|
|
8
|
+
isRelationship: (result: TResult) => result is TRelationship;
|
|
9
|
+
askConvertNode: (node: TNode) => AskResponse<GraphNodeResult>;
|
|
10
|
+
askConvertRelationship: (relationship: TRelationship) => AskResponse<GraphRelationshipResult>;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GraphResultConverters.js","sourceRoot":"","sources":["../../../../src/logic/graphDatabase/GraphResultConverters.ts"],"names":[],"mappings":"","sourcesContent":["import { GraphNodeResult } from '../../config/settings/graphDatabase/types/GraphNodeResult';\nimport { GraphRelationshipResult } from '../../config/settings/graphDatabase/types/GraphRelationshipResult';\nimport { AskResponse } from '../../types/StorySession';\n\n/** What a vendor supplies to turn its own result cells into the platform-neutral graph results. */\nexport type GraphResultConverters<TResult, TNode extends TResult, TRelationship extends TResult> = {\n vendor: string;\n isNode: (result: TResult) => result is TNode;\n isRelationship: (result: TResult) => result is TRelationship;\n askConvertNode: (node: TNode) => AskResponse<GraphNodeResult>;\n askConvertRelationship: (relationship: TRelationship) => AskResponse<GraphRelationshipResult>;\n};\n"]}
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
import { AnyGraphResult } from '../../config/settings/graphDatabase/types/AnyGraphResult';
|
|
2
|
-
import { GraphNodeResult } from '../../config/settings/graphDatabase/types/GraphNodeResult';
|
|
3
|
-
import { GraphRelationshipResult } from '../../config/settings/graphDatabase/types/GraphRelationshipResult';
|
|
4
2
|
import { AskResponse } from '../../types/StorySession';
|
|
5
|
-
|
|
6
|
-
export type GraphResultConverters<TResult, TNode extends TResult, TRelationship extends TResult> = {
|
|
7
|
-
vendor: string;
|
|
8
|
-
isNode: (result: TResult) => result is TNode;
|
|
9
|
-
isRelationship: (result: TResult) => result is TRelationship;
|
|
10
|
-
askConvertNode: (node: TNode) => AskResponse<GraphNodeResult>;
|
|
11
|
-
askConvertRelationship: (relationship: TRelationship) => AskResponse<GraphRelationshipResult>;
|
|
12
|
-
};
|
|
3
|
+
import { GraphResultConverters } from './GraphResultConverters';
|
|
13
4
|
/**
|
|
14
5
|
* Builds the story that converts any one cell of a vendor's query result: scalars pass through,
|
|
15
6
|
* nodes and relationships go through the vendor's converters, anything else is a wire-format
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAnyGraphResultConverter.js","sourceRoot":"","sources":["../../../../src/logic/graphDatabase/createAnyGraphResultConverter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"createAnyGraphResultConverter.js","sourceRoot":"","sources":["../../../../src/logic/graphDatabase/createAnyGraphResultConverter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAElE,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAG1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;;;GAIG;AACH,MAAM,UAAU,6BAA6B,CAC3C,UAAgE;IAEhE,OAAO,QAAQ,CAAC,CAAC,mCAAmC,CAAC,MAAe;QAClE,IAAI,mBAAmB,CAAC,MAAM,CAAC,EAAE,CAAC;YAChC,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,IAAI,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;YAC9B,OAAO,KAAK,CAAC,CAAC,UAAU,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QAClD,CAAC;QAED,IAAI,UAAU,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC;YACtC,OAAO,KAAK,CAAC,CAAC,UAAU,CAAC,sBAAsB,CAAC,MAAM,CAAC,CAAC;QAC1D,CAAC;QAED,OAAO,KAAK,CAAC,CAAC,aAAa,CAAC,aAAa,CAAC,YAAY,EAAE,qBAAqB,UAAU,CAAC,MAAM,eAAe,CAAC,CAAC;IACjH,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { askThrowError } from '../../actions/error/askThrowError';\nimport { AnyGraphResult } from '../../config/settings/graphDatabase/types/AnyGraphResult';\nimport { ErrorTypeEnum } from '../../types/ErrorTypeEnum';\nimport { AskResponse } from '../../types/StorySession';\nimport { GraphResultConverters } from './GraphResultConverters';\nimport { isGraphScalarResult } from './isGraphScalarResult';\n\n/**\n * Builds the story that converts any one cell of a vendor's query result: scalars pass through,\n * nodes and relationships go through the vendor's converters, anything else is a wire-format\n * drift and throws. Neptune and Neo4j share this shape and differ only in the guards and converters.\n */\nexport function createAnyGraphResultConverter<TResult, TNode extends TResult, TRelationship extends TResult>(\n converters: GraphResultConverters<TResult, TNode, TRelationship>,\n) {\n return function* askConvertAnyResultToAnyGraphResult(result: TResult): AskResponse<AnyGraphResult> {\n if (isGraphScalarResult(result)) {\n return result;\n }\n\n if (converters.isNode(result)) {\n return yield* converters.askConvertNode(result);\n }\n\n if (converters.isRelationship(result)) {\n return yield* converters.askConvertRelationship(result);\n }\n\n return yield* askThrowError(ErrorTypeEnum.GenericError, `Unable to convert ${converters.vendor} query result`);\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/logic/graphDatabase/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,uBAAuB,CAAC","sourcesContent":["export * from './createAnyGraphResultConverter';\nexport * from './isGraphScalarResult';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/logic/graphDatabase/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC","sourcesContent":["export * from './createAnyGraphResultConverter';\nexport * from './GraphResultConverters';\nexport * from './isGraphScalarResult';\n"]}
|