quidproquo-core 0.1.2 → 0.1.3
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/actions/index.d.ts +1 -0
- package/lib/commonjs/actions/index.js +1 -0
- package/lib/commonjs/actions/metric/MetricActionType.d.ts +3 -0
- package/lib/commonjs/actions/metric/MetricActionType.js +7 -0
- package/lib/commonjs/actions/metric/MetricPutActionRequester.d.ts +7 -0
- package/lib/commonjs/actions/metric/MetricPutActionRequester.js +15 -0
- package/lib/commonjs/actions/metric/MetricPutActionTypes.d.ts +20 -0
- package/lib/commonjs/actions/metric/MetricPutActionTypes.js +2 -0
- package/lib/commonjs/actions/metric/MetricUnit.d.ts +8 -0
- package/lib/commonjs/actions/metric/MetricUnit.js +13 -0
- package/lib/commonjs/actions/metric/index.d.ts +4 -0
- package/lib/commonjs/actions/metric/index.js +20 -0
- package/lib/commonjs/config/QPQConfig.d.ts +3 -1
- package/lib/commonjs/config/QPQConfig.js +2 -0
- package/lib/commonjs/config/settings/federatedModuleStore.d.ts +11 -0
- package/lib/commonjs/config/settings/federatedModuleStore.js +15 -0
- package/lib/commonjs/config/settings/index.d.ts +2 -0
- package/lib/commonjs/config/settings/index.js +2 -0
- package/lib/commonjs/config/settings/javascriptRuntime.d.ts +19 -0
- package/lib/commonjs/config/settings/javascriptRuntime.js +27 -0
- package/lib/commonjs/config/settings/schedule.d.ts +2 -0
- package/lib/commonjs/config/settings/schedule.js +1 -0
- package/lib/commonjs/qpqCoreUtils.d.ts +3 -1
- package/lib/commonjs/qpqCoreUtils.js +12 -2
- package/lib/commonjs/qpqCoreUtilsLib.d.ts +2 -0
- package/lib/commonjs/utils/path/getFederatedKeyFromQpqFunctionRuntime.d.ts +2 -0
- package/lib/commonjs/utils/path/getFederatedKeyFromQpqFunctionRuntime.js +21 -0
- package/lib/commonjs/utils/path/index.d.ts +1 -0
- package/lib/commonjs/utils/path/index.js +1 -0
- package/lib/esm/actions/index.d.ts +1 -0
- package/lib/esm/actions/index.js +1 -0
- package/lib/esm/actions/metric/MetricActionType.d.ts +3 -0
- package/lib/esm/actions/metric/MetricActionType.js +4 -0
- package/lib/esm/actions/metric/MetricPutActionRequester.d.ts +7 -0
- package/lib/esm/actions/metric/MetricPutActionRequester.js +12 -0
- package/lib/esm/actions/metric/MetricPutActionTypes.d.ts +20 -0
- package/lib/esm/actions/metric/MetricPutActionTypes.js +1 -0
- package/lib/esm/actions/metric/MetricUnit.d.ts +8 -0
- package/lib/esm/actions/metric/MetricUnit.js +10 -0
- package/lib/esm/actions/metric/index.d.ts +4 -0
- package/lib/esm/actions/metric/index.js +4 -0
- package/lib/esm/config/QPQConfig.d.ts +3 -1
- package/lib/esm/config/QPQConfig.js +2 -0
- package/lib/esm/config/settings/federatedModuleStore.d.ts +11 -0
- package/lib/esm/config/settings/federatedModuleStore.js +8 -0
- package/lib/esm/config/settings/index.d.ts +2 -0
- package/lib/esm/config/settings/index.js +2 -0
- package/lib/esm/config/settings/javascriptRuntime.d.ts +19 -0
- package/lib/esm/config/settings/javascriptRuntime.js +20 -0
- package/lib/esm/config/settings/schedule.d.ts +2 -0
- package/lib/esm/config/settings/schedule.js +1 -0
- package/lib/esm/qpqCoreUtils.d.ts +3 -1
- package/lib/esm/qpqCoreUtils.js +8 -1
- package/lib/esm/qpqCoreUtilsLib.d.ts +2 -0
- package/lib/esm/utils/path/getFederatedKeyFromQpqFunctionRuntime.d.ts +2 -0
- package/lib/esm/utils/path/getFederatedKeyFromQpqFunctionRuntime.js +18 -0
- package/lib/esm/utils/path/index.d.ts +1 -0
- package/lib/esm/utils/path/index.js +1 -0
- package/package.json +2 -2
|
@@ -29,6 +29,7 @@ __exportStar(require("./inlineFunction"), exports);
|
|
|
29
29
|
__exportStar(require("./keyValueStore"), exports);
|
|
30
30
|
__exportStar(require("./log"), exports);
|
|
31
31
|
__exportStar(require("./math"), exports);
|
|
32
|
+
__exportStar(require("./metric"), exports);
|
|
32
33
|
__exportStar(require("./network"), exports);
|
|
33
34
|
__exportStar(require("./platform"), exports);
|
|
34
35
|
__exportStar(require("./queue"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MetricActionType = void 0;
|
|
4
|
+
var MetricActionType;
|
|
5
|
+
(function (MetricActionType) {
|
|
6
|
+
MetricActionType["Put"] = "@quidproquo-core/Metric/Put";
|
|
7
|
+
})(MetricActionType || (exports.MetricActionType = MetricActionType = {}));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MetricPutActionRequester } from './MetricPutActionTypes';
|
|
2
|
+
import { MetricUnit } from './MetricUnit';
|
|
3
|
+
export interface AskMetricPutOptions {
|
|
4
|
+
unit?: MetricUnit;
|
|
5
|
+
dimensions?: Record<string, string>;
|
|
6
|
+
}
|
|
7
|
+
export declare function askMetricPut(metricName: string, value?: number, options?: AskMetricPutOptions): MetricPutActionRequester;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.askMetricPut = askMetricPut;
|
|
4
|
+
const MetricActionType_1 = require("./MetricActionType");
|
|
5
|
+
function* askMetricPut(metricName, value = 1, options) {
|
|
6
|
+
return yield {
|
|
7
|
+
type: MetricActionType_1.MetricActionType.Put,
|
|
8
|
+
payload: {
|
|
9
|
+
metricName,
|
|
10
|
+
value,
|
|
11
|
+
unit: options === null || options === void 0 ? void 0 : options.unit,
|
|
12
|
+
dimensions: options === null || options === void 0 ? void 0 : options.dimensions,
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Action, ActionProcessor, ActionRequester } from '../../types/Action';
|
|
2
|
+
import { MetricActionType } from './MetricActionType';
|
|
3
|
+
import { MetricUnit } from './MetricUnit';
|
|
4
|
+
export interface MetricPutActionPayload {
|
|
5
|
+
metricName: string;
|
|
6
|
+
value: number;
|
|
7
|
+
unit?: MetricUnit;
|
|
8
|
+
/**
|
|
9
|
+
* Extra metric dimensions on top of the standard service/environment ones. Each unique
|
|
10
|
+
* dimension combination is its own metric (and its own cost) - keep these
|
|
11
|
+
* low-cardinality: never per-user or per-request identifiers.
|
|
12
|
+
*/
|
|
13
|
+
dimensions?: Record<string, string>;
|
|
14
|
+
}
|
|
15
|
+
export interface MetricPutAction extends Action<MetricPutActionPayload> {
|
|
16
|
+
type: MetricActionType.Put;
|
|
17
|
+
payload: MetricPutActionPayload;
|
|
18
|
+
}
|
|
19
|
+
export type MetricPutActionProcessor = ActionProcessor<MetricPutAction, void>;
|
|
20
|
+
export type MetricPutActionRequester = ActionRequester<MetricPutAction, void>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MetricUnit = void 0;
|
|
4
|
+
// Values are the CloudWatch unit strings.
|
|
5
|
+
var MetricUnit;
|
|
6
|
+
(function (MetricUnit) {
|
|
7
|
+
MetricUnit["count"] = "Count";
|
|
8
|
+
MetricUnit["milliseconds"] = "Milliseconds";
|
|
9
|
+
MetricUnit["seconds"] = "Seconds";
|
|
10
|
+
MetricUnit["bytes"] = "Bytes";
|
|
11
|
+
MetricUnit["percent"] = "Percent";
|
|
12
|
+
MetricUnit["none"] = "None";
|
|
13
|
+
})(MetricUnit || (exports.MetricUnit = MetricUnit = {}));
|
|
@@ -0,0 +1,20 @@
|
|
|
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("./MetricActionType"), exports);
|
|
18
|
+
__exportStar(require("./MetricPutActionRequester"), exports);
|
|
19
|
+
__exportStar(require("./MetricPutActionTypes"), exports);
|
|
20
|
+
__exportStar(require("./MetricUnit"), exports);
|
|
@@ -22,7 +22,9 @@ export declare enum QPQCoreConfigSettingType {
|
|
|
22
22
|
graphDatabase = "@quidproquo-core/config/GraphDatabase",
|
|
23
23
|
virtualNetwork = "@quidproquo-core/config/VirtualNetwork",
|
|
24
24
|
notifyError = "@quidproquo-core/config/notifyError",
|
|
25
|
-
inlineFunction = "@quidproquo-core/config/InlineFunction"
|
|
25
|
+
inlineFunction = "@quidproquo-core/config/InlineFunction",
|
|
26
|
+
javascriptRuntime = "@quidproquo-core/config/JavascriptRuntime",
|
|
27
|
+
federatedModuleStore = "@quidproquo-core/config/FederatedModuleStore"
|
|
26
28
|
}
|
|
27
29
|
export interface QPQConfigSetting {
|
|
28
30
|
configSettingType: string;
|
|
@@ -26,4 +26,6 @@ var QPQCoreConfigSettingType;
|
|
|
26
26
|
QPQCoreConfigSettingType["virtualNetwork"] = "@quidproquo-core/config/VirtualNetwork";
|
|
27
27
|
QPQCoreConfigSettingType["notifyError"] = "@quidproquo-core/config/notifyError";
|
|
28
28
|
QPQCoreConfigSettingType["inlineFunction"] = "@quidproquo-core/config/InlineFunction";
|
|
29
|
+
QPQCoreConfigSettingType["javascriptRuntime"] = "@quidproquo-core/config/JavascriptRuntime";
|
|
30
|
+
QPQCoreConfigSettingType["federatedModuleStore"] = "@quidproquo-core/config/FederatedModuleStore";
|
|
29
31
|
})(QPQCoreConfigSettingType || (exports.QPQCoreConfigSettingType = QPQCoreConfigSettingType = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { QPQConfigSetting } from '../QPQConfig';
|
|
2
|
+
export interface FederatedModuleStoreOptions {
|
|
3
|
+
recheckMs?: number;
|
|
4
|
+
bundleFallback?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface FederatedModuleStoreQPQConfigSetting extends QPQConfigSetting {
|
|
7
|
+
storageDrive: string;
|
|
8
|
+
recheckMs?: number;
|
|
9
|
+
bundleFallback: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const defineFederatedModuleStore: (storageDrive: string, options?: FederatedModuleStoreOptions) => FederatedModuleStoreQPQConfigSetting;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defineFederatedModuleStore = void 0;
|
|
4
|
+
const QPQConfig_1 = require("../QPQConfig");
|
|
5
|
+
const defineFederatedModuleStore = (storageDrive, options) => {
|
|
6
|
+
var _a;
|
|
7
|
+
return ({
|
|
8
|
+
configSettingType: QPQConfig_1.QPQCoreConfigSettingType.federatedModuleStore,
|
|
9
|
+
uniqueKey: 'FederatedModuleStore',
|
|
10
|
+
storageDrive,
|
|
11
|
+
recheckMs: options === null || options === void 0 ? void 0 : options.recheckMs,
|
|
12
|
+
bundleFallback: (_a = options === null || options === void 0 ? void 0 : options.bundleFallback) !== null && _a !== void 0 ? _a : true,
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
exports.defineFederatedModuleStore = defineFederatedModuleStore;
|
|
@@ -11,9 +11,11 @@ export * from './deployEvent';
|
|
|
11
11
|
export * from './emailTemplates';
|
|
12
12
|
export * from './environmentSettings';
|
|
13
13
|
export * from './eventBus';
|
|
14
|
+
export * from './federatedModuleStore';
|
|
14
15
|
export * from './global';
|
|
15
16
|
export * from './graphDatabase';
|
|
16
17
|
export * from './inlineFunction';
|
|
18
|
+
export * from './javascriptRuntime';
|
|
17
19
|
export * from './keyValueStore';
|
|
18
20
|
export * from './moduleName';
|
|
19
21
|
export * from './notifyError';
|
|
@@ -27,9 +27,11 @@ __exportStar(require("./deployEvent"), exports);
|
|
|
27
27
|
__exportStar(require("./emailTemplates"), exports);
|
|
28
28
|
__exportStar(require("./environmentSettings"), exports);
|
|
29
29
|
__exportStar(require("./eventBus"), exports);
|
|
30
|
+
__exportStar(require("./federatedModuleStore"), exports);
|
|
30
31
|
__exportStar(require("./global"), exports);
|
|
31
32
|
__exportStar(require("./graphDatabase"), exports);
|
|
32
33
|
__exportStar(require("./inlineFunction"), exports);
|
|
34
|
+
__exportStar(require("./javascriptRuntime"), exports);
|
|
33
35
|
__exportStar(require("./keyValueStore"), exports);
|
|
34
36
|
__exportStar(require("./moduleName"), exports);
|
|
35
37
|
__exportStar(require("./notifyError"), exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { QPQConfigAdvancedSettings, QPQConfigSetting } from '../QPQConfig';
|
|
2
|
+
export declare enum JavascriptRuntimeVersion {
|
|
3
|
+
Node20 = "node20",
|
|
4
|
+
Node22 = "node22",
|
|
5
|
+
Node24 = "node24"
|
|
6
|
+
}
|
|
7
|
+
export declare enum JavascriptRuntimeArchitecture {
|
|
8
|
+
Arm64 = "arm64",
|
|
9
|
+
X86_64 = "x86_64"
|
|
10
|
+
}
|
|
11
|
+
export interface QPQConfigAdvancedJavascriptRuntimeSettings extends QPQConfigAdvancedSettings {
|
|
12
|
+
runtimeVersion?: JavascriptRuntimeVersion;
|
|
13
|
+
architecture?: JavascriptRuntimeArchitecture;
|
|
14
|
+
}
|
|
15
|
+
export interface JavascriptRuntimeQPQConfigSetting extends QPQConfigSetting {
|
|
16
|
+
runtimeVersion: JavascriptRuntimeVersion;
|
|
17
|
+
architecture: JavascriptRuntimeArchitecture;
|
|
18
|
+
}
|
|
19
|
+
export declare const defineJavascriptRuntime: (options?: QPQConfigAdvancedJavascriptRuntimeSettings) => JavascriptRuntimeQPQConfigSetting;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defineJavascriptRuntime = exports.JavascriptRuntimeArchitecture = exports.JavascriptRuntimeVersion = void 0;
|
|
4
|
+
const QPQConfig_1 = require("../QPQConfig");
|
|
5
|
+
// Cloud-agnostic runtime identifiers - the deploy layer maps these to
|
|
6
|
+
// platform specific values (e.g. aws_lambda.Runtime / aws_lambda.Architecture)
|
|
7
|
+
var JavascriptRuntimeVersion;
|
|
8
|
+
(function (JavascriptRuntimeVersion) {
|
|
9
|
+
JavascriptRuntimeVersion["Node20"] = "node20";
|
|
10
|
+
JavascriptRuntimeVersion["Node22"] = "node22";
|
|
11
|
+
JavascriptRuntimeVersion["Node24"] = "node24";
|
|
12
|
+
})(JavascriptRuntimeVersion || (exports.JavascriptRuntimeVersion = JavascriptRuntimeVersion = {}));
|
|
13
|
+
var JavascriptRuntimeArchitecture;
|
|
14
|
+
(function (JavascriptRuntimeArchitecture) {
|
|
15
|
+
JavascriptRuntimeArchitecture["Arm64"] = "arm64";
|
|
16
|
+
JavascriptRuntimeArchitecture["X86_64"] = "x86_64";
|
|
17
|
+
})(JavascriptRuntimeArchitecture || (exports.JavascriptRuntimeArchitecture = JavascriptRuntimeArchitecture = {}));
|
|
18
|
+
const defineJavascriptRuntime = (options) => {
|
|
19
|
+
var _a, _b;
|
|
20
|
+
return ({
|
|
21
|
+
configSettingType: QPQConfig_1.QPQCoreConfigSettingType.javascriptRuntime,
|
|
22
|
+
uniqueKey: 'JavascriptRuntime',
|
|
23
|
+
runtimeVersion: (_a = options === null || options === void 0 ? void 0 : options.runtimeVersion) !== null && _a !== void 0 ? _a : JavascriptRuntimeVersion.Node22,
|
|
24
|
+
architecture: (_b = options === null || options === void 0 ? void 0 : options.architecture) !== null && _b !== void 0 ? _b : JavascriptRuntimeArchitecture.Arm64,
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
exports.defineJavascriptRuntime = defineJavascriptRuntime;
|
|
@@ -6,12 +6,14 @@ export declare enum ScheduleTypeEnum {
|
|
|
6
6
|
export interface QPQConfigAdvancedScheduleSettings extends QPQConfigAdvancedSettings {
|
|
7
7
|
metadata?: Record<string, any>;
|
|
8
8
|
owner?: CrossModuleOwner<'recurringSchedule'>;
|
|
9
|
+
maxConcurrentExecutions?: number;
|
|
9
10
|
}
|
|
10
11
|
export interface ScheduleQPQConfigSetting extends QPQConfigSetting {
|
|
11
12
|
scheduleType: ScheduleTypeEnum;
|
|
12
13
|
runtime: QpqFunctionRuntime;
|
|
13
14
|
cronExpression: string;
|
|
14
15
|
metadata: Record<string, any>;
|
|
16
|
+
maxConcurrentExecutions?: number;
|
|
15
17
|
owner?: CrossModuleOwner;
|
|
16
18
|
}
|
|
17
19
|
/**
|
|
@@ -77,6 +77,7 @@ const defineRecurringSchedule = (cronExpression, runtime, options) => {
|
|
|
77
77
|
runtime,
|
|
78
78
|
cronExpression,
|
|
79
79
|
metadata: (options === null || options === void 0 ? void 0 : options.metadata) || {},
|
|
80
|
+
maxConcurrentExecutions: options === null || options === void 0 ? void 0 : options.maxConcurrentExecutions,
|
|
80
81
|
owner: (0, crossModuleUtils_1.convertCrossModuleOwnerToGenericResourceNameOverride)(options === null || options === void 0 ? void 0 : options.owner),
|
|
81
82
|
};
|
|
82
83
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AiQPQConfigSetting, ApplicationQPQConfigSetting, ClaudeAIQPQConfigSetting, DeployEventsQPQConfigSetting, EmailTemplates, EventBusQPQConfigSetting, GraphDatabaseQPQConfigSetting, InlineFunctionQPQConfigSetting, KeyValueStoreQPQConfigSetting, NotifyErrorQPQConfigSetting, ParameterQPQConfigSetting, QPQConfig, QPQConfigSetting, QpqQueueProcessors, QueueQPQConfigSetting, ScheduleQPQConfigSetting, SecretQPQConfigSetting, StorageDriveQPQConfigSetting, UserDirectoryQPQConfigSetting, VirtualNetworkQPQConfigSetting } from './config';
|
|
1
|
+
import { AiQPQConfigSetting, ApplicationQPQConfigSetting, ClaudeAIQPQConfigSetting, DeployEventsQPQConfigSetting, EmailTemplates, EventBusQPQConfigSetting, FederatedModuleStoreQPQConfigSetting, GraphDatabaseQPQConfigSetting, InlineFunctionQPQConfigSetting, JavascriptRuntimeQPQConfigSetting, KeyValueStoreQPQConfigSetting, NotifyErrorQPQConfigSetting, ParameterQPQConfigSetting, QPQConfig, QPQConfigSetting, QpqQueueProcessors, QueueQPQConfigSetting, ScheduleQPQConfigSetting, SecretQPQConfigSetting, StorageDriveQPQConfigSetting, UserDirectoryQPQConfigSetting, VirtualNetworkQPQConfigSetting } from './config';
|
|
2
2
|
import { ConfigUrl, CrossServiceResourceName, CustomFullyQualifiedResource, FullyQualifiedResource, QpqFunctionRuntime, ResourceName } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* Flattens a QPQConfig array into a single array of QPQConfigSetting objects.
|
|
@@ -43,6 +43,7 @@ export declare const getConfigRoot: (qpqConfig: QPQConfig) => string;
|
|
|
43
43
|
export declare const getApplicationModuleEnvironment: (qpqConfig: QPQConfig) => string;
|
|
44
44
|
export declare const getStorageDrives: (configs: QPQConfig) => StorageDriveQPQConfigSetting[];
|
|
45
45
|
export declare const getStorageDriveByName: (storageDriveName: string, configs: QPQConfig) => StorageDriveQPQConfigSetting | undefined;
|
|
46
|
+
export declare const getFederatedModuleStore: (qpqConfig: QPQConfig) => FederatedModuleStoreQPQConfigSetting | undefined;
|
|
46
47
|
export declare const getQueues: (configs: QPQConfig) => QueueQPQConfigSetting[];
|
|
47
48
|
export declare const getOwnedQueues: (configs: QPQConfig) => QueueQPQConfigSetting[];
|
|
48
49
|
export declare const getNotifyErrorConfigs: (configs: QPQConfig) => NotifyErrorQPQConfigSetting[];
|
|
@@ -50,6 +51,7 @@ export declare const getQueueByName: (configs: QPQConfig, name: string) => Queue
|
|
|
50
51
|
export declare const getStorageDriveNames: (configs: QPQConfig) => string[];
|
|
51
52
|
export declare const getAllEventBusConfigs: (qpqConfig: QPQConfig) => EventBusQPQConfigSetting[];
|
|
52
53
|
export declare const getAllAiConfigs: (qpqConfig: QPQConfig) => AiQPQConfigSetting[];
|
|
54
|
+
export declare const getJavascriptRuntimeConfig: (qpqConfig: QPQConfig) => JavascriptRuntimeQPQConfigSetting;
|
|
53
55
|
export declare const getAllClaudeAiConfigs: (qpqConfig: QPQConfig) => ClaudeAIQPQConfigSetting[];
|
|
54
56
|
export declare const getOwnedEventBusConfigs: (qpqConfig: QPQConfig) => EventBusQPQConfigSetting[];
|
|
55
57
|
export declare const getEventBusConfigByName: (eventBusName: string, qpqConfig: QPQConfig) => EventBusQPQConfigSetting | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.getFullUrlFromConfigUrl = exports.isSameResource = exports.getKeyValueStoreFullyQualifiedResourceName = exports.getFullyQualifiedResourceName = exports.convertCustomFullyQualifiedResourceToGeneric = exports.getQueueQueueProcessors = exports.getUniqueKeyForSetting = exports.getOwnedParameterConfigs = exports.getParameterConfig = exports.getAllParameterConfigs = exports.getUserDirectoryByName = void 0;
|
|
3
|
+
exports.resolveGlobalValue = exports.getGlobalConfigValue = exports.getOwnedSecrets = exports.getAllSecretConfigs = exports.getSecretByName = exports.getSrcFilenameFromQpqFunctionRuntime = exports.getApiBuildPath = exports.getAllSrcEntries = exports.getOwnedInlineFunctions = exports.getAllInlineFunctions = exports.getUserDirectorySrcEntries = exports.getQueueSrcEntries = exports.getOwnedScheduleEvents = exports.getScheduleEvents = exports.getUserDirectoryEmailTemplates = exports.getActionProcessorSources = exports.getKeyValueStoreByName = exports.resolveCrossServiceResourceName = exports.getOwnedStorageDrives = exports.getOwnedGraphDatabases = exports.getOwnedKeyValueStores = exports.getVirualNetworkConfigs = exports.getDeployEventConfigs = exports.getAllGraphDatabaseConfigs = exports.getAllKeyValueStores = exports.getOwnedItems = exports.getEventBusConfigByName = exports.getOwnedEventBusConfigs = exports.getAllClaudeAiConfigs = exports.getJavascriptRuntimeConfig = exports.getAllAiConfigs = exports.getAllEventBusConfigs = exports.getStorageDriveNames = exports.getQueueByName = exports.getNotifyErrorConfigs = exports.getOwnedQueues = exports.getQueues = exports.getFederatedModuleStore = exports.getStorageDriveByName = exports.getStorageDrives = exports.getApplicationModuleEnvironment = exports.getConfigRoot = exports.getApplicationModuleFeature = exports.getApplicationName = exports.getApplicationConfigRoot = exports.getApplicationModuleName = exports.getApplicationConfigSetting = exports.getConfigSetting = exports.getConfigSettings = exports.flattenQpqConfig = void 0;
|
|
4
|
+
exports.getFullUrlFromConfigUrl = exports.isSameResource = exports.getKeyValueStoreFullyQualifiedResourceName = exports.getFullyQualifiedResourceName = exports.convertCustomFullyQualifiedResourceToGeneric = exports.getQueueQueueProcessors = exports.getUniqueKeyForSetting = exports.getOwnedParameterConfigs = exports.getParameterConfig = exports.getAllParameterConfigs = exports.getUserDirectoryByName = exports.getOwnedUserDirectories = exports.getUserDirectories = void 0;
|
|
5
5
|
const config_1 = require("./config");
|
|
6
6
|
const utils_1 = require("./utils");
|
|
7
7
|
/**
|
|
@@ -143,6 +143,10 @@ const getStorageDriveByName = (storageDriveName, configs) => {
|
|
|
143
143
|
return (0, exports.getStorageDrives)(configs).find((sd) => sd.storageDrive === storageDriveName);
|
|
144
144
|
};
|
|
145
145
|
exports.getStorageDriveByName = getStorageDriveByName;
|
|
146
|
+
const getFederatedModuleStore = (qpqConfig) => {
|
|
147
|
+
return (0, exports.getConfigSetting)(qpqConfig, config_1.QPQCoreConfigSettingType.federatedModuleStore);
|
|
148
|
+
};
|
|
149
|
+
exports.getFederatedModuleStore = getFederatedModuleStore;
|
|
146
150
|
const getQueues = (configs) => {
|
|
147
151
|
return (0, exports.getConfigSettings)(configs, config_1.QPQCoreConfigSettingType.queue);
|
|
148
152
|
};
|
|
@@ -173,6 +177,12 @@ const getAllAiConfigs = (qpqConfig) => {
|
|
|
173
177
|
return (0, exports.getConfigSettings)(qpqConfig, config_1.QPQCoreConfigSettingType.ai);
|
|
174
178
|
};
|
|
175
179
|
exports.getAllAiConfigs = getAllAiConfigs;
|
|
180
|
+
// Always resolves - falls back to the defineJavascriptRuntime defaults when no setting is present
|
|
181
|
+
const getJavascriptRuntimeConfig = (qpqConfig) => {
|
|
182
|
+
var _a;
|
|
183
|
+
return (_a = (0, exports.getConfigSetting)(qpqConfig, config_1.QPQCoreConfigSettingType.javascriptRuntime)) !== null && _a !== void 0 ? _a : (0, config_1.defineJavascriptRuntime)();
|
|
184
|
+
};
|
|
185
|
+
exports.getJavascriptRuntimeConfig = getJavascriptRuntimeConfig;
|
|
176
186
|
const getAllClaudeAiConfigs = (qpqConfig) => {
|
|
177
187
|
const claudeAis = (0, exports.getConfigSettings)(qpqConfig, config_1.QPQCoreConfigSettingType.claudeAi);
|
|
178
188
|
return claudeAis;
|
|
@@ -14,6 +14,7 @@ export declare const qpqCoreUtils: {
|
|
|
14
14
|
getApplicationModuleEnvironment: (qpqConfig: import("./config").QPQConfig) => string;
|
|
15
15
|
getStorageDrives: (configs: import("./config").QPQConfig) => import("./config").StorageDriveQPQConfigSetting[];
|
|
16
16
|
getStorageDriveByName: (storageDriveName: string, configs: import("./config").QPQConfig) => import("./config").StorageDriveQPQConfigSetting | undefined;
|
|
17
|
+
getFederatedModuleStore: (qpqConfig: import("./config").QPQConfig) => import("./config").FederatedModuleStoreQPQConfigSetting | undefined;
|
|
17
18
|
getQueues: (configs: import("./config").QPQConfig) => import("./config").QueueQPQConfigSetting[];
|
|
18
19
|
getOwnedQueues: (configs: import("./config").QPQConfig) => import("./config").QueueQPQConfigSetting[];
|
|
19
20
|
getNotifyErrorConfigs: (configs: import("./config").QPQConfig) => import("./config").NotifyErrorQPQConfigSetting[];
|
|
@@ -21,6 +22,7 @@ export declare const qpqCoreUtils: {
|
|
|
21
22
|
getStorageDriveNames: (configs: import("./config").QPQConfig) => string[];
|
|
22
23
|
getAllEventBusConfigs: (qpqConfig: import("./config").QPQConfig) => import("./config").EventBusQPQConfigSetting[];
|
|
23
24
|
getAllAiConfigs: (qpqConfig: import("./config").QPQConfig) => import("./config").AiQPQConfigSetting[];
|
|
25
|
+
getJavascriptRuntimeConfig: (qpqConfig: import("./config").QPQConfig) => import("./config").JavascriptRuntimeQPQConfigSetting;
|
|
24
26
|
getAllClaudeAiConfigs: (qpqConfig: import("./config").QPQConfig) => import("./config").ClaudeAIQPQConfigSetting[];
|
|
25
27
|
getOwnedEventBusConfigs: (qpqConfig: import("./config").QPQConfig) => import("./config").EventBusQPQConfigSetting[];
|
|
26
28
|
getEventBusConfigByName: (eventBusName: string, qpqConfig: import("./config").QPQConfig) => import("./config").EventBusQPQConfigSetting | undefined;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFederatedKeyFromQpqFunctionRuntime = getFederatedKeyFromQpqFunctionRuntime;
|
|
4
|
+
const isQpqFunctionRuntimeAdvanced_1 = require("./isQpqFunctionRuntimeAdvanced");
|
|
5
|
+
// A machine-INDEPENDENT identity key for a runtime, used to match a published
|
|
6
|
+
// federated module against the runtime the lambda asks for.
|
|
7
|
+
//
|
|
8
|
+
// getUniqueKeyFromQpqFunctionRuntime is unsuitable here: for advanced runtimes it
|
|
9
|
+
// embeds `basePath`, an absolute filesystem path. Federation deliberately builds
|
|
10
|
+
// the lambda shell and publishes the artifacts as separate steps (often on
|
|
11
|
+
// different machines / CI), so an absolute path in the key makes the publisher's
|
|
12
|
+
// manifest key never equal the lambda's lookup key. We key on the relative path +
|
|
13
|
+
// function name instead, which is stable across machines.
|
|
14
|
+
function getFederatedKeyFromQpqFunctionRuntime(qpqFunctionRuntime) {
|
|
15
|
+
if ((0, isQpqFunctionRuntimeAdvanced_1.isQpqFunctionRuntimeAdvanced)(qpqFunctionRuntime)) {
|
|
16
|
+
const relativePath = qpqFunctionRuntime.relativePath.replace(/\\/g, '/').replace(/^\//, '');
|
|
17
|
+
return `${relativePath}::${qpqFunctionRuntime.functionName}`;
|
|
18
|
+
}
|
|
19
|
+
// Relative-string runtimes are already machine-independent.
|
|
20
|
+
return qpqFunctionRuntime;
|
|
21
|
+
}
|
|
@@ -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("./getFederatedKeyFromQpqFunctionRuntime"), exports);
|
|
17
18
|
__exportStar(require("./getUniqueKeyFromQpqFunctionRuntime"), exports);
|
|
18
19
|
__exportStar(require("./isQpqFunctionRuntimeAdvanced"), exports);
|
|
19
20
|
__exportStar(require("./isQpqFunctionRuntimeRelativePath"), exports);
|
package/lib/esm/actions/index.js
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MetricPutActionRequester } from './MetricPutActionTypes';
|
|
2
|
+
import { MetricUnit } from './MetricUnit';
|
|
3
|
+
export interface AskMetricPutOptions {
|
|
4
|
+
unit?: MetricUnit;
|
|
5
|
+
dimensions?: Record<string, string>;
|
|
6
|
+
}
|
|
7
|
+
export declare function askMetricPut(metricName: string, value?: number, options?: AskMetricPutOptions): MetricPutActionRequester;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MetricActionType } from './MetricActionType';
|
|
2
|
+
export function* askMetricPut(metricName, value = 1, options) {
|
|
3
|
+
return yield {
|
|
4
|
+
type: MetricActionType.Put,
|
|
5
|
+
payload: {
|
|
6
|
+
metricName,
|
|
7
|
+
value,
|
|
8
|
+
unit: options?.unit,
|
|
9
|
+
dimensions: options?.dimensions,
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Action, ActionProcessor, ActionRequester } from '../../types/Action';
|
|
2
|
+
import { MetricActionType } from './MetricActionType';
|
|
3
|
+
import { MetricUnit } from './MetricUnit';
|
|
4
|
+
export interface MetricPutActionPayload {
|
|
5
|
+
metricName: string;
|
|
6
|
+
value: number;
|
|
7
|
+
unit?: MetricUnit;
|
|
8
|
+
/**
|
|
9
|
+
* Extra metric dimensions on top of the standard service/environment ones. Each unique
|
|
10
|
+
* dimension combination is its own metric (and its own cost) - keep these
|
|
11
|
+
* low-cardinality: never per-user or per-request identifiers.
|
|
12
|
+
*/
|
|
13
|
+
dimensions?: Record<string, string>;
|
|
14
|
+
}
|
|
15
|
+
export interface MetricPutAction extends Action<MetricPutActionPayload> {
|
|
16
|
+
type: MetricActionType.Put;
|
|
17
|
+
payload: MetricPutActionPayload;
|
|
18
|
+
}
|
|
19
|
+
export type MetricPutActionProcessor = ActionProcessor<MetricPutAction, void>;
|
|
20
|
+
export type MetricPutActionRequester = ActionRequester<MetricPutAction, void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Values are the CloudWatch unit strings.
|
|
2
|
+
export var MetricUnit;
|
|
3
|
+
(function (MetricUnit) {
|
|
4
|
+
MetricUnit["count"] = "Count";
|
|
5
|
+
MetricUnit["milliseconds"] = "Milliseconds";
|
|
6
|
+
MetricUnit["seconds"] = "Seconds";
|
|
7
|
+
MetricUnit["bytes"] = "Bytes";
|
|
8
|
+
MetricUnit["percent"] = "Percent";
|
|
9
|
+
MetricUnit["none"] = "None";
|
|
10
|
+
})(MetricUnit || (MetricUnit = {}));
|
|
@@ -22,7 +22,9 @@ export declare enum QPQCoreConfigSettingType {
|
|
|
22
22
|
graphDatabase = "@quidproquo-core/config/GraphDatabase",
|
|
23
23
|
virtualNetwork = "@quidproquo-core/config/VirtualNetwork",
|
|
24
24
|
notifyError = "@quidproquo-core/config/notifyError",
|
|
25
|
-
inlineFunction = "@quidproquo-core/config/InlineFunction"
|
|
25
|
+
inlineFunction = "@quidproquo-core/config/InlineFunction",
|
|
26
|
+
javascriptRuntime = "@quidproquo-core/config/JavascriptRuntime",
|
|
27
|
+
federatedModuleStore = "@quidproquo-core/config/FederatedModuleStore"
|
|
26
28
|
}
|
|
27
29
|
export interface QPQConfigSetting {
|
|
28
30
|
configSettingType: string;
|
|
@@ -23,4 +23,6 @@ export var QPQCoreConfigSettingType;
|
|
|
23
23
|
QPQCoreConfigSettingType["virtualNetwork"] = "@quidproquo-core/config/VirtualNetwork";
|
|
24
24
|
QPQCoreConfigSettingType["notifyError"] = "@quidproquo-core/config/notifyError";
|
|
25
25
|
QPQCoreConfigSettingType["inlineFunction"] = "@quidproquo-core/config/InlineFunction";
|
|
26
|
+
QPQCoreConfigSettingType["javascriptRuntime"] = "@quidproquo-core/config/JavascriptRuntime";
|
|
27
|
+
QPQCoreConfigSettingType["federatedModuleStore"] = "@quidproquo-core/config/FederatedModuleStore";
|
|
26
28
|
})(QPQCoreConfigSettingType || (QPQCoreConfigSettingType = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { QPQConfigSetting } from '../QPQConfig';
|
|
2
|
+
export interface FederatedModuleStoreOptions {
|
|
3
|
+
recheckMs?: number;
|
|
4
|
+
bundleFallback?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface FederatedModuleStoreQPQConfigSetting extends QPQConfigSetting {
|
|
7
|
+
storageDrive: string;
|
|
8
|
+
recheckMs?: number;
|
|
9
|
+
bundleFallback: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const defineFederatedModuleStore: (storageDrive: string, options?: FederatedModuleStoreOptions) => FederatedModuleStoreQPQConfigSetting;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { QPQCoreConfigSettingType } from '../QPQConfig';
|
|
2
|
+
export const defineFederatedModuleStore = (storageDrive, options) => ({
|
|
3
|
+
configSettingType: QPQCoreConfigSettingType.federatedModuleStore,
|
|
4
|
+
uniqueKey: 'FederatedModuleStore',
|
|
5
|
+
storageDrive,
|
|
6
|
+
recheckMs: options?.recheckMs,
|
|
7
|
+
bundleFallback: options?.bundleFallback ?? true,
|
|
8
|
+
});
|
|
@@ -11,9 +11,11 @@ export * from './deployEvent';
|
|
|
11
11
|
export * from './emailTemplates';
|
|
12
12
|
export * from './environmentSettings';
|
|
13
13
|
export * from './eventBus';
|
|
14
|
+
export * from './federatedModuleStore';
|
|
14
15
|
export * from './global';
|
|
15
16
|
export * from './graphDatabase';
|
|
16
17
|
export * from './inlineFunction';
|
|
18
|
+
export * from './javascriptRuntime';
|
|
17
19
|
export * from './keyValueStore';
|
|
18
20
|
export * from './moduleName';
|
|
19
21
|
export * from './notifyError';
|
|
@@ -11,9 +11,11 @@ export * from './deployEvent';
|
|
|
11
11
|
export * from './emailTemplates';
|
|
12
12
|
export * from './environmentSettings';
|
|
13
13
|
export * from './eventBus';
|
|
14
|
+
export * from './federatedModuleStore';
|
|
14
15
|
export * from './global';
|
|
15
16
|
export * from './graphDatabase';
|
|
16
17
|
export * from './inlineFunction';
|
|
18
|
+
export * from './javascriptRuntime';
|
|
17
19
|
export * from './keyValueStore';
|
|
18
20
|
export * from './moduleName';
|
|
19
21
|
export * from './notifyError';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { QPQConfigAdvancedSettings, QPQConfigSetting } from '../QPQConfig';
|
|
2
|
+
export declare enum JavascriptRuntimeVersion {
|
|
3
|
+
Node20 = "node20",
|
|
4
|
+
Node22 = "node22",
|
|
5
|
+
Node24 = "node24"
|
|
6
|
+
}
|
|
7
|
+
export declare enum JavascriptRuntimeArchitecture {
|
|
8
|
+
Arm64 = "arm64",
|
|
9
|
+
X86_64 = "x86_64"
|
|
10
|
+
}
|
|
11
|
+
export interface QPQConfigAdvancedJavascriptRuntimeSettings extends QPQConfigAdvancedSettings {
|
|
12
|
+
runtimeVersion?: JavascriptRuntimeVersion;
|
|
13
|
+
architecture?: JavascriptRuntimeArchitecture;
|
|
14
|
+
}
|
|
15
|
+
export interface JavascriptRuntimeQPQConfigSetting extends QPQConfigSetting {
|
|
16
|
+
runtimeVersion: JavascriptRuntimeVersion;
|
|
17
|
+
architecture: JavascriptRuntimeArchitecture;
|
|
18
|
+
}
|
|
19
|
+
export declare const defineJavascriptRuntime: (options?: QPQConfigAdvancedJavascriptRuntimeSettings) => JavascriptRuntimeQPQConfigSetting;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { QPQCoreConfigSettingType } from '../QPQConfig';
|
|
2
|
+
// Cloud-agnostic runtime identifiers - the deploy layer maps these to
|
|
3
|
+
// platform specific values (e.g. aws_lambda.Runtime / aws_lambda.Architecture)
|
|
4
|
+
export var JavascriptRuntimeVersion;
|
|
5
|
+
(function (JavascriptRuntimeVersion) {
|
|
6
|
+
JavascriptRuntimeVersion["Node20"] = "node20";
|
|
7
|
+
JavascriptRuntimeVersion["Node22"] = "node22";
|
|
8
|
+
JavascriptRuntimeVersion["Node24"] = "node24";
|
|
9
|
+
})(JavascriptRuntimeVersion || (JavascriptRuntimeVersion = {}));
|
|
10
|
+
export var JavascriptRuntimeArchitecture;
|
|
11
|
+
(function (JavascriptRuntimeArchitecture) {
|
|
12
|
+
JavascriptRuntimeArchitecture["Arm64"] = "arm64";
|
|
13
|
+
JavascriptRuntimeArchitecture["X86_64"] = "x86_64";
|
|
14
|
+
})(JavascriptRuntimeArchitecture || (JavascriptRuntimeArchitecture = {}));
|
|
15
|
+
export const defineJavascriptRuntime = (options) => ({
|
|
16
|
+
configSettingType: QPQCoreConfigSettingType.javascriptRuntime,
|
|
17
|
+
uniqueKey: 'JavascriptRuntime',
|
|
18
|
+
runtimeVersion: options?.runtimeVersion ?? JavascriptRuntimeVersion.Node22,
|
|
19
|
+
architecture: options?.architecture ?? JavascriptRuntimeArchitecture.Arm64,
|
|
20
|
+
});
|
|
@@ -6,12 +6,14 @@ export declare enum ScheduleTypeEnum {
|
|
|
6
6
|
export interface QPQConfigAdvancedScheduleSettings extends QPQConfigAdvancedSettings {
|
|
7
7
|
metadata?: Record<string, any>;
|
|
8
8
|
owner?: CrossModuleOwner<'recurringSchedule'>;
|
|
9
|
+
maxConcurrentExecutions?: number;
|
|
9
10
|
}
|
|
10
11
|
export interface ScheduleQPQConfigSetting extends QPQConfigSetting {
|
|
11
12
|
scheduleType: ScheduleTypeEnum;
|
|
12
13
|
runtime: QpqFunctionRuntime;
|
|
13
14
|
cronExpression: string;
|
|
14
15
|
metadata: Record<string, any>;
|
|
16
|
+
maxConcurrentExecutions?: number;
|
|
15
17
|
owner?: CrossModuleOwner;
|
|
16
18
|
}
|
|
17
19
|
/**
|
|
@@ -74,6 +74,7 @@ export const defineRecurringSchedule = (cronExpression, runtime, options) => {
|
|
|
74
74
|
runtime,
|
|
75
75
|
cronExpression,
|
|
76
76
|
metadata: options?.metadata || {},
|
|
77
|
+
maxConcurrentExecutions: options?.maxConcurrentExecutions,
|
|
77
78
|
owner: convertCrossModuleOwnerToGenericResourceNameOverride(options?.owner),
|
|
78
79
|
};
|
|
79
80
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AiQPQConfigSetting, ApplicationQPQConfigSetting, ClaudeAIQPQConfigSetting, DeployEventsQPQConfigSetting, EmailTemplates, EventBusQPQConfigSetting, GraphDatabaseQPQConfigSetting, InlineFunctionQPQConfigSetting, KeyValueStoreQPQConfigSetting, NotifyErrorQPQConfigSetting, ParameterQPQConfigSetting, QPQConfig, QPQConfigSetting, QpqQueueProcessors, QueueQPQConfigSetting, ScheduleQPQConfigSetting, SecretQPQConfigSetting, StorageDriveQPQConfigSetting, UserDirectoryQPQConfigSetting, VirtualNetworkQPQConfigSetting } from './config';
|
|
1
|
+
import { AiQPQConfigSetting, ApplicationQPQConfigSetting, ClaudeAIQPQConfigSetting, DeployEventsQPQConfigSetting, EmailTemplates, EventBusQPQConfigSetting, FederatedModuleStoreQPQConfigSetting, GraphDatabaseQPQConfigSetting, InlineFunctionQPQConfigSetting, JavascriptRuntimeQPQConfigSetting, KeyValueStoreQPQConfigSetting, NotifyErrorQPQConfigSetting, ParameterQPQConfigSetting, QPQConfig, QPQConfigSetting, QpqQueueProcessors, QueueQPQConfigSetting, ScheduleQPQConfigSetting, SecretQPQConfigSetting, StorageDriveQPQConfigSetting, UserDirectoryQPQConfigSetting, VirtualNetworkQPQConfigSetting } from './config';
|
|
2
2
|
import { ConfigUrl, CrossServiceResourceName, CustomFullyQualifiedResource, FullyQualifiedResource, QpqFunctionRuntime, ResourceName } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* Flattens a QPQConfig array into a single array of QPQConfigSetting objects.
|
|
@@ -43,6 +43,7 @@ export declare const getConfigRoot: (qpqConfig: QPQConfig) => string;
|
|
|
43
43
|
export declare const getApplicationModuleEnvironment: (qpqConfig: QPQConfig) => string;
|
|
44
44
|
export declare const getStorageDrives: (configs: QPQConfig) => StorageDriveQPQConfigSetting[];
|
|
45
45
|
export declare const getStorageDriveByName: (storageDriveName: string, configs: QPQConfig) => StorageDriveQPQConfigSetting | undefined;
|
|
46
|
+
export declare const getFederatedModuleStore: (qpqConfig: QPQConfig) => FederatedModuleStoreQPQConfigSetting | undefined;
|
|
46
47
|
export declare const getQueues: (configs: QPQConfig) => QueueQPQConfigSetting[];
|
|
47
48
|
export declare const getOwnedQueues: (configs: QPQConfig) => QueueQPQConfigSetting[];
|
|
48
49
|
export declare const getNotifyErrorConfigs: (configs: QPQConfig) => NotifyErrorQPQConfigSetting[];
|
|
@@ -50,6 +51,7 @@ export declare const getQueueByName: (configs: QPQConfig, name: string) => Queue
|
|
|
50
51
|
export declare const getStorageDriveNames: (configs: QPQConfig) => string[];
|
|
51
52
|
export declare const getAllEventBusConfigs: (qpqConfig: QPQConfig) => EventBusQPQConfigSetting[];
|
|
52
53
|
export declare const getAllAiConfigs: (qpqConfig: QPQConfig) => AiQPQConfigSetting[];
|
|
54
|
+
export declare const getJavascriptRuntimeConfig: (qpqConfig: QPQConfig) => JavascriptRuntimeQPQConfigSetting;
|
|
53
55
|
export declare const getAllClaudeAiConfigs: (qpqConfig: QPQConfig) => ClaudeAIQPQConfigSetting[];
|
|
54
56
|
export declare const getOwnedEventBusConfigs: (qpqConfig: QPQConfig) => EventBusQPQConfigSetting[];
|
|
55
57
|
export declare const getEventBusConfigByName: (eventBusName: string, qpqConfig: QPQConfig) => EventBusQPQConfigSetting | undefined;
|
package/lib/esm/qpqCoreUtils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { QPQCoreConfigSettingType, } from './config';
|
|
1
|
+
import { defineJavascriptRuntime, QPQCoreConfigSettingType, } from './config';
|
|
2
2
|
import { isQpqFunctionRuntimeAdvanced } from './utils';
|
|
3
3
|
/**
|
|
4
4
|
* Flattens a QPQConfig array into a single array of QPQConfigSetting objects.
|
|
@@ -126,6 +126,9 @@ export const getStorageDrives = (configs) => {
|
|
|
126
126
|
export const getStorageDriveByName = (storageDriveName, configs) => {
|
|
127
127
|
return getStorageDrives(configs).find((sd) => sd.storageDrive === storageDriveName);
|
|
128
128
|
};
|
|
129
|
+
export const getFederatedModuleStore = (qpqConfig) => {
|
|
130
|
+
return getConfigSetting(qpqConfig, QPQCoreConfigSettingType.federatedModuleStore);
|
|
131
|
+
};
|
|
129
132
|
export const getQueues = (configs) => {
|
|
130
133
|
return getConfigSettings(configs, QPQCoreConfigSettingType.queue);
|
|
131
134
|
};
|
|
@@ -149,6 +152,10 @@ export const getAllEventBusConfigs = (qpqConfig) => {
|
|
|
149
152
|
export const getAllAiConfigs = (qpqConfig) => {
|
|
150
153
|
return getConfigSettings(qpqConfig, QPQCoreConfigSettingType.ai);
|
|
151
154
|
};
|
|
155
|
+
// Always resolves - falls back to the defineJavascriptRuntime defaults when no setting is present
|
|
156
|
+
export const getJavascriptRuntimeConfig = (qpqConfig) => {
|
|
157
|
+
return getConfigSetting(qpqConfig, QPQCoreConfigSettingType.javascriptRuntime) ?? defineJavascriptRuntime();
|
|
158
|
+
};
|
|
152
159
|
export const getAllClaudeAiConfigs = (qpqConfig) => {
|
|
153
160
|
const claudeAis = getConfigSettings(qpqConfig, QPQCoreConfigSettingType.claudeAi);
|
|
154
161
|
return claudeAis;
|
|
@@ -14,6 +14,7 @@ export declare const qpqCoreUtils: {
|
|
|
14
14
|
getApplicationModuleEnvironment: (qpqConfig: import("./config").QPQConfig) => string;
|
|
15
15
|
getStorageDrives: (configs: import("./config").QPQConfig) => import("./config").StorageDriveQPQConfigSetting[];
|
|
16
16
|
getStorageDriveByName: (storageDriveName: string, configs: import("./config").QPQConfig) => import("./config").StorageDriveQPQConfigSetting | undefined;
|
|
17
|
+
getFederatedModuleStore: (qpqConfig: import("./config").QPQConfig) => import("./config").FederatedModuleStoreQPQConfigSetting | undefined;
|
|
17
18
|
getQueues: (configs: import("./config").QPQConfig) => import("./config").QueueQPQConfigSetting[];
|
|
18
19
|
getOwnedQueues: (configs: import("./config").QPQConfig) => import("./config").QueueQPQConfigSetting[];
|
|
19
20
|
getNotifyErrorConfigs: (configs: import("./config").QPQConfig) => import("./config").NotifyErrorQPQConfigSetting[];
|
|
@@ -21,6 +22,7 @@ export declare const qpqCoreUtils: {
|
|
|
21
22
|
getStorageDriveNames: (configs: import("./config").QPQConfig) => string[];
|
|
22
23
|
getAllEventBusConfigs: (qpqConfig: import("./config").QPQConfig) => import("./config").EventBusQPQConfigSetting[];
|
|
23
24
|
getAllAiConfigs: (qpqConfig: import("./config").QPQConfig) => import("./config").AiQPQConfigSetting[];
|
|
25
|
+
getJavascriptRuntimeConfig: (qpqConfig: import("./config").QPQConfig) => import("./config").JavascriptRuntimeQPQConfigSetting;
|
|
24
26
|
getAllClaudeAiConfigs: (qpqConfig: import("./config").QPQConfig) => import("./config").ClaudeAIQPQConfigSetting[];
|
|
25
27
|
getOwnedEventBusConfigs: (qpqConfig: import("./config").QPQConfig) => import("./config").EventBusQPQConfigSetting[];
|
|
26
28
|
getEventBusConfigByName: (eventBusName: string, qpqConfig: import("./config").QPQConfig) => import("./config").EventBusQPQConfigSetting | undefined;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { isQpqFunctionRuntimeAdvanced } from './isQpqFunctionRuntimeAdvanced';
|
|
2
|
+
// A machine-INDEPENDENT identity key for a runtime, used to match a published
|
|
3
|
+
// federated module against the runtime the lambda asks for.
|
|
4
|
+
//
|
|
5
|
+
// getUniqueKeyFromQpqFunctionRuntime is unsuitable here: for advanced runtimes it
|
|
6
|
+
// embeds `basePath`, an absolute filesystem path. Federation deliberately builds
|
|
7
|
+
// the lambda shell and publishes the artifacts as separate steps (often on
|
|
8
|
+
// different machines / CI), so an absolute path in the key makes the publisher's
|
|
9
|
+
// manifest key never equal the lambda's lookup key. We key on the relative path +
|
|
10
|
+
// function name instead, which is stable across machines.
|
|
11
|
+
export function getFederatedKeyFromQpqFunctionRuntime(qpqFunctionRuntime) {
|
|
12
|
+
if (isQpqFunctionRuntimeAdvanced(qpqFunctionRuntime)) {
|
|
13
|
+
const relativePath = qpqFunctionRuntime.relativePath.replace(/\\/g, '/').replace(/^\//, '');
|
|
14
|
+
return `${relativePath}::${qpqFunctionRuntime.functionName}`;
|
|
15
|
+
}
|
|
16
|
+
// Relative-string runtimes are already machine-independent.
|
|
17
|
+
return qpqFunctionRuntime;
|
|
18
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quidproquo-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/commonjs/index.js",
|
|
6
6
|
"module": "./lib/esm/index.js",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"homepage": "https://github.com/joe-coady/quidproquo#readme",
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/node": "^24.2.1",
|
|
36
|
-
"quidproquo-tsconfig": "0.1.
|
|
36
|
+
"quidproquo-tsconfig": "0.1.3",
|
|
37
37
|
"typescript": "^5.8.2"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|