quidproquo-core
Advanced tools
Comparing version 0.0.169 to 0.0.170
@@ -1,20 +0,21 @@ | ||
import { CrossModuleOwner } from '../../types'; | ||
import { CrossModuleOwner, KeyOf } from '../../types'; | ||
import { QPQConfigSetting, QPQConfigAdvancedSettings } from '../QPQConfig'; | ||
export type KvsKeyType = 'string' | 'number' | 'binary'; | ||
export type KvsKey = { | ||
key: string; | ||
export type KvsKey<T extends object = any> = { | ||
key: KeyOf<T>; | ||
type: KvsKeyType; | ||
}; | ||
export type KvsIndex = { | ||
partitionKey: KvsKey; | ||
sortKey?: KvsKey; | ||
export type KvsIndex<T extends object = any> = { | ||
partitionKey: KvsKey<T>; | ||
sortKey?: KvsKey<T>; | ||
}; | ||
export declare const kvsKey: (key: string, type?: KvsKeyType) => KvsKey; | ||
type CompositeKvsKey = KvsKey | string; | ||
export type CompositeKvsIndex = string | { | ||
partitionKey: CompositeKvsKey; | ||
sortKey?: CompositeKvsKey; | ||
export declare const kvsKey: <T extends object = any>(key: Extract<keyof T, string>, type?: KvsKeyType) => KvsKey<T>; | ||
type CompositeKvsKey<T extends object = any> = KvsKey<T> | KeyOf<T>; | ||
type CompositeCompositeKvsIndex<T extends object = any> = { | ||
partitionKey: CompositeKvsKey<T>; | ||
sortKey?: CompositeKvsKey<T>; | ||
}; | ||
export interface QPQConfigAdvancedKeyValueStoreSettings extends QPQConfigAdvancedSettings { | ||
indexes?: CompositeKvsIndex[]; | ||
export type CompositeKvsIndex<T extends object = any> = KeyOf<T> | CompositeCompositeKvsIndex<T>; | ||
export interface QPQConfigAdvancedKeyValueStoreSettings<T extends object = any> extends QPQConfigAdvancedSettings { | ||
indexes?: CompositeKvsIndex<T>[]; | ||
global?: boolean; | ||
@@ -25,7 +26,7 @@ owner?: CrossModuleOwner; | ||
} | ||
export interface KeyValueStoreQPQConfigSetting extends QPQConfigSetting { | ||
export interface KeyValueStoreQPQConfigSetting<T extends object = any> extends QPQConfigSetting { | ||
keyValueStoreName: string; | ||
partitionKey: KvsKey; | ||
sortKeys: KvsKey[]; | ||
indexes: KvsIndex[]; | ||
partitionKey: KvsKey<T>; | ||
sortKeys: KvsKey<T>[]; | ||
indexes: KvsIndex<T>[]; | ||
global: boolean; | ||
@@ -35,3 +36,3 @@ ttlAttribute?: string; | ||
} | ||
export declare const defineKeyValueStore: (keyValueStoreName: string, partitionKey: CompositeKvsKey, sortKeys?: CompositeKvsKey[], options?: QPQConfigAdvancedKeyValueStoreSettings) => KeyValueStoreQPQConfigSetting; | ||
export declare const defineKeyValueStore: <T extends object = any>(keyValueStoreName: string, partitionKey: CompositeKvsKey<T>, sortKeys?: CompositeKvsKey<T>[], options?: QPQConfigAdvancedKeyValueStoreSettings<T> | undefined) => KeyValueStoreQPQConfigSetting<T>; | ||
export {}; |
@@ -11,9 +11,14 @@ "use strict"; | ||
const convertCompositeKvsKeyToKvsKey = (compositeKvsKey) => { | ||
// Must be a keyof T | ||
if (typeof compositeKvsKey === 'string') { | ||
return (0, exports.kvsKey)(compositeKvsKey, 'string'); | ||
} | ||
// must be a KvsKey<T> | ||
return compositeKvsKey; | ||
}; | ||
const isCompositeKvsIndexACompositeCompositeKvsIndex = (compositeKvsIndex) => { | ||
return typeof compositeKvsIndex !== 'string'; | ||
}; | ||
const convertCompositeKvsIndexToKvsIndex = (compositeKvsIndex) => { | ||
if (typeof compositeKvsIndex === 'string') { | ||
if (!isCompositeKvsIndexACompositeCompositeKvsIndex(compositeKvsIndex)) { | ||
return { | ||
@@ -37,4 +42,4 @@ partitionKey: (0, exports.kvsKey)(compositeKvsIndex, 'string'), | ||
partitionKey: convertCompositeKvsKeyToKvsKey(partitionKey), | ||
sortKeys: sortKeys.map(convertCompositeKvsKeyToKvsKey), | ||
indexes: ((_a = options === null || options === void 0 ? void 0 : options.indexes) !== null && _a !== void 0 ? _a : []).map(convertCompositeKvsIndexToKvsIndex), | ||
sortKeys: sortKeys.map((convertCompositeKvsKeyToKvsKey)), | ||
indexes: ((_a = options === null || options === void 0 ? void 0 : options.indexes) !== null && _a !== void 0 ? _a : []).map((convertCompositeKvsIndexToKvsIndex)), | ||
global: (_b = options === null || options === void 0 ? void 0 : options.global) !== null && _b !== void 0 ? _b : false, | ||
@@ -41,0 +46,0 @@ owner: options === null || options === void 0 ? void 0 : options.owner, |
@@ -54,8 +54,8 @@ import { QPQConfig, QPQConfigSetting } from './config/QPQConfig'; | ||
export declare const getOwnedItems: <T extends QPQConfigSetting>(settings: T[], qpqConfig: QPQConfig) => T[]; | ||
export declare const getAllKeyValueStores: (qpqConfig: QPQConfig) => KeyValueStoreQPQConfigSetting[]; | ||
export declare const getAllKeyValueStores: <T extends object = any>(qpqConfig: QPQConfig) => KeyValueStoreQPQConfigSetting<T>[]; | ||
export declare const getDeployEventConfigs: (qpqConfig: QPQConfig) => DeployEventsQPQConfigSetting[]; | ||
export declare const getOwnedKeyValueStores: (qpqConfig: QPQConfig) => KeyValueStoreQPQConfigSetting[]; | ||
export declare const getOwnedKeyValueStores: <T extends object = any>(qpqConfig: QPQConfig) => KeyValueStoreQPQConfigSetting<T>[]; | ||
export declare const getOwnedStorageDrives: (qpqConfig: QPQConfig) => StorageDriveQPQConfigSetting[]; | ||
export declare const resolveCrossServiceResourceName: (resourceName: ResourceName) => CrossServiceResourceName; | ||
export declare const getKeyValueStoreByName: (qpqConfig: QPQConfig, kvsName: string) => KeyValueStoreQPQConfigSetting | undefined; | ||
export declare const getKeyValueStoreByName: <T extends object = any>(qpqConfig: QPQConfig, kvsName: string) => KeyValueStoreQPQConfigSetting<T> | undefined; | ||
export declare const getActionProcessorSources: (configs: QPQConfig) => string[]; | ||
@@ -62,0 +62,0 @@ export declare const getUserDirectoryEmailTemplates: (qpqConfig: QPQConfig) => Record<string, EmailTemplates>; |
@@ -16,1 +16,2 @@ export * from './Action'; | ||
export * from './UnboundLogicStory'; | ||
export * from './KeyOf'; |
@@ -32,1 +32,2 @@ "use strict"; | ||
__exportStar(require("./UnboundLogicStory"), exports); | ||
__exportStar(require("./KeyOf"), exports); |
@@ -1,2 +0,2 @@ | ||
export interface ScheduledEventParams<T> { | ||
export interface ScheduledEventParams<T = void> { | ||
time: string; | ||
@@ -3,0 +3,0 @@ correlation: string; |
{ | ||
"name": "quidproquo-core", | ||
"version": "0.0.169", | ||
"version": "0.0.170", | ||
"description": "", | ||
@@ -28,5 +28,5 @@ "main": "./lib/commonjs/index.js", | ||
"devDependencies": { | ||
"quidproquo-tsconfig": "0.0.169", | ||
"quidproquo-tsconfig": "0.0.170", | ||
"typescript": "^4.9.3" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
274849
444
5359