dynamodb-expression-builder 0.1.1 → 0.3.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/README.md +4 -4
- package/dist/index.cjs +615 -9
- package/dist/index.d.cts +51 -3
- package/dist/index.d.ts +51 -3
- package/dist/index.js +602 -10
- package/package.json +7 -2
package/dist/index.d.cts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Wire-format (uppercase) operator union. INLINED copy of the app's
|
|
4
4
|
* `WireFilterOperator` (`src/schemas/dynamodb-schemas.ts`).
|
|
5
5
|
*/
|
|
6
|
-
type WireFilterOperator = 'EQ' | 'NE' | 'GT' | 'GE' | 'LT' | 'LE' | 'CONTAINS' | 'BEGINS_WITH' | 'BETWEEN' | 'IN' | 'EXISTS' | 'NOT_EXISTS' | 'SIZE_EQ' | 'SIZE_NE' | 'SIZE_LT' | 'SIZE_LE' | 'SIZE_GT' | 'SIZE_GE' | 'TYPE_EQ' | 'TYPE_NE';
|
|
6
|
+
type WireFilterOperator = 'EQ' | 'NE' | 'GT' | 'GE' | 'LT' | 'LE' | 'CONTAINS' | 'NOT_CONTAINS' | 'BEGINS_WITH' | 'BETWEEN' | 'IN' | 'EXISTS' | 'NOT_EXISTS' | 'SIZE_EQ' | 'SIZE_NE' | 'SIZE_LT' | 'SIZE_LE' | 'SIZE_GT' | 'SIZE_GE' | 'TYPE_EQ' | 'TYPE_NE';
|
|
7
7
|
/**
|
|
8
8
|
* Data types the compat map reasons about. `L`/`M` are included even though the
|
|
9
9
|
* tool's Type selector doesn't expose them — they keep the compat table a
|
|
@@ -101,6 +101,16 @@ declare const FILTER_OPERATORS: readonly [{
|
|
|
101
101
|
readonly typeOptional: false;
|
|
102
102
|
readonly keyAllowedTypes: readonly [];
|
|
103
103
|
readonly scanAllowedTypes: readonly ["S", "B", "SS", "NS", "BS", "L"];
|
|
104
|
+
}, {
|
|
105
|
+
readonly value: "not_contains";
|
|
106
|
+
readonly label: "Not Contains";
|
|
107
|
+
readonly symbol: "∌";
|
|
108
|
+
readonly wireForm: "NOT_CONTAINS";
|
|
109
|
+
readonly requiresValue: true;
|
|
110
|
+
readonly requiresValue2: false;
|
|
111
|
+
readonly typeOptional: false;
|
|
112
|
+
readonly keyAllowedTypes: readonly [];
|
|
113
|
+
readonly scanAllowedTypes: readonly ["S", "B", "SS", "NS", "BS", "L"];
|
|
104
114
|
}, {
|
|
105
115
|
readonly value: "begins_with";
|
|
106
116
|
readonly label: "Begins With";
|
|
@@ -600,6 +610,44 @@ declare function dotnetClientMethodName(operation: DdbOperation): string;
|
|
|
600
610
|
/** Emit the bare `new <Op>Request { … }` snippet for a canonical request. */
|
|
601
611
|
declare function emitDotnet(request: CanonicalRequest): string;
|
|
602
612
|
//#endregion
|
|
613
|
+
//#region src/emit/rust.d.ts
|
|
614
|
+
/** The `Client` method name (snake_case) for an operation. */
|
|
615
|
+
declare function rustClientMethodName(operation: DdbOperation): string;
|
|
616
|
+
/** Render one wire AttributeValue as an `AttributeValue::…` constructor. */
|
|
617
|
+
declare function renderRustAv(av: AttributeValue): string;
|
|
618
|
+
/** Emit the bare fluent call for a canonical request (awaited, `?`-propagated). */
|
|
619
|
+
declare function emitRust(request: CanonicalRequest): string;
|
|
620
|
+
//#endregion
|
|
621
|
+
//#region src/emit/docclient.d.ts
|
|
622
|
+
/** The lib-dynamodb command class name for an operation. */
|
|
623
|
+
declare function docClientCommandName(operation: DdbOperation): string;
|
|
624
|
+
/** Emit the bare `new XCommand({…})` snippet with native values. */
|
|
625
|
+
declare function emitDocClient(request: CanonicalRequest): string;
|
|
626
|
+
//#endregion
|
|
627
|
+
//#region src/emit/kotlin.d.ts
|
|
628
|
+
/** The client method name (camelCase) for an operation. */
|
|
629
|
+
declare function kotlinClientMethodName(operation: DdbOperation): string;
|
|
630
|
+
/** Render one wire AttributeValue as an `AttributeValue.…` constructor. */
|
|
631
|
+
declare function renderKotlinAv(av: AttributeValue): string;
|
|
632
|
+
/** Emit the bare `val response = client.…{ … }` call for a canonical request. */
|
|
633
|
+
declare function emitKotlin(request: CanonicalRequest): string;
|
|
634
|
+
//#endregion
|
|
635
|
+
//#region src/emit/php.d.ts
|
|
636
|
+
/** The client method name (camelCase) for an operation. */
|
|
637
|
+
declare function phpClientMethodName(operation: DdbOperation): string;
|
|
638
|
+
/** Render one wire AttributeValue as a nested `['TAG' => …]` literal. */
|
|
639
|
+
declare function renderPhpAv(av: AttributeValue): string;
|
|
640
|
+
/** Emit the bare `$response = $client->…([…]);` call for a canonical request. */
|
|
641
|
+
declare function emitPhp(request: CanonicalRequest): string;
|
|
642
|
+
//#endregion
|
|
643
|
+
//#region src/emit/ruby.d.ts
|
|
644
|
+
/** The client method name (snake_case) for an operation. */
|
|
645
|
+
declare function rubyClientMethodName(operation: DdbOperation): string;
|
|
646
|
+
/** Render one typed value as the native Ruby literal the SDK marshals. */
|
|
647
|
+
declare function renderRubyValue(tv: TypedValue): string;
|
|
648
|
+
/** Emit the bare `response = client.…(…)` call for a canonical request. */
|
|
649
|
+
declare function emitRuby(request: CanonicalRequest): string;
|
|
650
|
+
//#endregion
|
|
603
651
|
//#region src/emit/ddbtoolbox.d.ts
|
|
604
652
|
/**
|
|
605
653
|
* Emit the runnable dynamodb-toolbox program for a Query/Scan canonical request.
|
|
@@ -618,7 +666,7 @@ interface QueryToolConfig extends BuilderConfig {
|
|
|
618
666
|
/** Emit the fetch-all-pages pagination loop (default: single request). */
|
|
619
667
|
paginate?: boolean;
|
|
620
668
|
}
|
|
621
|
-
type QueryProgramFormat = 'sdk' | 'cli' | 'boto3' | 'partiql' | 'java' | 'go' | 'dotnet' | 'ddbtoolbox';
|
|
669
|
+
type QueryProgramFormat = 'sdk' | 'docclient' | 'cli' | 'boto3' | 'partiql' | 'java' | 'go' | 'dotnet' | 'rust' | 'kotlin' | 'php' | 'ruby' | 'ddbtoolbox';
|
|
622
670
|
/** A runnable program, or an honest reason the format can't express it. */
|
|
623
671
|
type ProgramResult = {
|
|
624
672
|
ok: true;
|
|
@@ -636,4 +684,4 @@ type ProgramResult = {
|
|
|
636
684
|
*/
|
|
637
685
|
declare function emitQueryProgram(config: QueryToolConfig, format: QueryProgramFormat): ProgramResult;
|
|
638
686
|
//#endregion
|
|
639
|
-
export { type AttributeValue, type BuilderConfig, type CanonicalRequest, type DdbOperation, type DdbScalarType, FILTER_OPERATORS, type FilterDataType, type FilterOperatorOption, type FilterRow, type ItemAttr, KEY_OPERATORS, type KeyAttr, type KeyConditionResult, OPERATOR_BY_VALUE, type OperatorDef, type OperatorValue, type PartiqlResult, type PredicateExpression, type PredicatePrefix, type ProgramResult, type QueryProgramFormat, type QueryToolConfig, type RangeKeyCondition, SET_TYPES, type SetOperation, type SetType, type TypedValue, type UpdateAction, type UpdateActionKind, type UpdateExpressionResult, type WireFilterOperator, boto3MethodName, buildFilterExpressions, buildKeyConditionExpression, buildKeyMap, buildRequest, buildSdkV3Params, buildUpdateExpression, dotnetClientMethodName, dotnetRequestClassName, elementType, emitBoto3, emitCli, emitDdbToolboxProgram, emitDotnet, emitGo, emitJava, emitPartiql, emitQueryProgram, emitSdkV3, getCompatibleComparisonOperators, getCompatibleFilterOperators, goClientMethodName, goInputTypeName, hasBinaryValue, isSetType, javaClientMethodName, javaRequestClassName, makeTypedValue, renderJsValue, renderPyValue, sdkV3CommandName, typedMapToAvMap, typedValueToAv };
|
|
687
|
+
export { type AttributeValue, type BuilderConfig, type CanonicalRequest, type DdbOperation, type DdbScalarType, FILTER_OPERATORS, type FilterDataType, type FilterOperatorOption, type FilterRow, type ItemAttr, KEY_OPERATORS, type KeyAttr, type KeyConditionResult, OPERATOR_BY_VALUE, type OperatorDef, type OperatorValue, type PartiqlResult, type PredicateExpression, type PredicatePrefix, type ProgramResult, type QueryProgramFormat, type QueryToolConfig, type RangeKeyCondition, SET_TYPES, type SetOperation, type SetType, type TypedValue, type UpdateAction, type UpdateActionKind, type UpdateExpressionResult, type WireFilterOperator, boto3MethodName, buildFilterExpressions, buildKeyConditionExpression, buildKeyMap, buildRequest, buildSdkV3Params, buildUpdateExpression, docClientCommandName, dotnetClientMethodName, dotnetRequestClassName, elementType, emitBoto3, emitCli, emitDdbToolboxProgram, emitDocClient, emitDotnet, emitGo, emitJava, emitKotlin, emitPartiql, emitPhp, emitQueryProgram, emitRuby, emitRust, emitSdkV3, getCompatibleComparisonOperators, getCompatibleFilterOperators, goClientMethodName, goInputTypeName, hasBinaryValue, isSetType, javaClientMethodName, javaRequestClassName, kotlinClientMethodName, makeTypedValue, phpClientMethodName, renderJsValue, renderKotlinAv, renderPhpAv, renderPyValue, renderRubyValue, renderRustAv, rubyClientMethodName, rustClientMethodName, sdkV3CommandName, typedMapToAvMap, typedValueToAv };
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Wire-format (uppercase) operator union. INLINED copy of the app's
|
|
4
4
|
* `WireFilterOperator` (`src/schemas/dynamodb-schemas.ts`).
|
|
5
5
|
*/
|
|
6
|
-
type WireFilterOperator = 'EQ' | 'NE' | 'GT' | 'GE' | 'LT' | 'LE' | 'CONTAINS' | 'BEGINS_WITH' | 'BETWEEN' | 'IN' | 'EXISTS' | 'NOT_EXISTS' | 'SIZE_EQ' | 'SIZE_NE' | 'SIZE_LT' | 'SIZE_LE' | 'SIZE_GT' | 'SIZE_GE' | 'TYPE_EQ' | 'TYPE_NE';
|
|
6
|
+
type WireFilterOperator = 'EQ' | 'NE' | 'GT' | 'GE' | 'LT' | 'LE' | 'CONTAINS' | 'NOT_CONTAINS' | 'BEGINS_WITH' | 'BETWEEN' | 'IN' | 'EXISTS' | 'NOT_EXISTS' | 'SIZE_EQ' | 'SIZE_NE' | 'SIZE_LT' | 'SIZE_LE' | 'SIZE_GT' | 'SIZE_GE' | 'TYPE_EQ' | 'TYPE_NE';
|
|
7
7
|
/**
|
|
8
8
|
* Data types the compat map reasons about. `L`/`M` are included even though the
|
|
9
9
|
* tool's Type selector doesn't expose them — they keep the compat table a
|
|
@@ -101,6 +101,16 @@ declare const FILTER_OPERATORS: readonly [{
|
|
|
101
101
|
readonly typeOptional: false;
|
|
102
102
|
readonly keyAllowedTypes: readonly [];
|
|
103
103
|
readonly scanAllowedTypes: readonly ["S", "B", "SS", "NS", "BS", "L"];
|
|
104
|
+
}, {
|
|
105
|
+
readonly value: "not_contains";
|
|
106
|
+
readonly label: "Not Contains";
|
|
107
|
+
readonly symbol: "∌";
|
|
108
|
+
readonly wireForm: "NOT_CONTAINS";
|
|
109
|
+
readonly requiresValue: true;
|
|
110
|
+
readonly requiresValue2: false;
|
|
111
|
+
readonly typeOptional: false;
|
|
112
|
+
readonly keyAllowedTypes: readonly [];
|
|
113
|
+
readonly scanAllowedTypes: readonly ["S", "B", "SS", "NS", "BS", "L"];
|
|
104
114
|
}, {
|
|
105
115
|
readonly value: "begins_with";
|
|
106
116
|
readonly label: "Begins With";
|
|
@@ -600,6 +610,44 @@ declare function dotnetClientMethodName(operation: DdbOperation): string;
|
|
|
600
610
|
/** Emit the bare `new <Op>Request { … }` snippet for a canonical request. */
|
|
601
611
|
declare function emitDotnet(request: CanonicalRequest): string;
|
|
602
612
|
//#endregion
|
|
613
|
+
//#region src/emit/rust.d.ts
|
|
614
|
+
/** The `Client` method name (snake_case) for an operation. */
|
|
615
|
+
declare function rustClientMethodName(operation: DdbOperation): string;
|
|
616
|
+
/** Render one wire AttributeValue as an `AttributeValue::…` constructor. */
|
|
617
|
+
declare function renderRustAv(av: AttributeValue): string;
|
|
618
|
+
/** Emit the bare fluent call for a canonical request (awaited, `?`-propagated). */
|
|
619
|
+
declare function emitRust(request: CanonicalRequest): string;
|
|
620
|
+
//#endregion
|
|
621
|
+
//#region src/emit/docclient.d.ts
|
|
622
|
+
/** The lib-dynamodb command class name for an operation. */
|
|
623
|
+
declare function docClientCommandName(operation: DdbOperation): string;
|
|
624
|
+
/** Emit the bare `new XCommand({…})` snippet with native values. */
|
|
625
|
+
declare function emitDocClient(request: CanonicalRequest): string;
|
|
626
|
+
//#endregion
|
|
627
|
+
//#region src/emit/kotlin.d.ts
|
|
628
|
+
/** The client method name (camelCase) for an operation. */
|
|
629
|
+
declare function kotlinClientMethodName(operation: DdbOperation): string;
|
|
630
|
+
/** Render one wire AttributeValue as an `AttributeValue.…` constructor. */
|
|
631
|
+
declare function renderKotlinAv(av: AttributeValue): string;
|
|
632
|
+
/** Emit the bare `val response = client.…{ … }` call for a canonical request. */
|
|
633
|
+
declare function emitKotlin(request: CanonicalRequest): string;
|
|
634
|
+
//#endregion
|
|
635
|
+
//#region src/emit/php.d.ts
|
|
636
|
+
/** The client method name (camelCase) for an operation. */
|
|
637
|
+
declare function phpClientMethodName(operation: DdbOperation): string;
|
|
638
|
+
/** Render one wire AttributeValue as a nested `['TAG' => …]` literal. */
|
|
639
|
+
declare function renderPhpAv(av: AttributeValue): string;
|
|
640
|
+
/** Emit the bare `$response = $client->…([…]);` call for a canonical request. */
|
|
641
|
+
declare function emitPhp(request: CanonicalRequest): string;
|
|
642
|
+
//#endregion
|
|
643
|
+
//#region src/emit/ruby.d.ts
|
|
644
|
+
/** The client method name (snake_case) for an operation. */
|
|
645
|
+
declare function rubyClientMethodName(operation: DdbOperation): string;
|
|
646
|
+
/** Render one typed value as the native Ruby literal the SDK marshals. */
|
|
647
|
+
declare function renderRubyValue(tv: TypedValue): string;
|
|
648
|
+
/** Emit the bare `response = client.…(…)` call for a canonical request. */
|
|
649
|
+
declare function emitRuby(request: CanonicalRequest): string;
|
|
650
|
+
//#endregion
|
|
603
651
|
//#region src/emit/ddbtoolbox.d.ts
|
|
604
652
|
/**
|
|
605
653
|
* Emit the runnable dynamodb-toolbox program for a Query/Scan canonical request.
|
|
@@ -618,7 +666,7 @@ interface QueryToolConfig extends BuilderConfig {
|
|
|
618
666
|
/** Emit the fetch-all-pages pagination loop (default: single request). */
|
|
619
667
|
paginate?: boolean;
|
|
620
668
|
}
|
|
621
|
-
type QueryProgramFormat = 'sdk' | 'cli' | 'boto3' | 'partiql' | 'java' | 'go' | 'dotnet' | 'ddbtoolbox';
|
|
669
|
+
type QueryProgramFormat = 'sdk' | 'docclient' | 'cli' | 'boto3' | 'partiql' | 'java' | 'go' | 'dotnet' | 'rust' | 'kotlin' | 'php' | 'ruby' | 'ddbtoolbox';
|
|
622
670
|
/** A runnable program, or an honest reason the format can't express it. */
|
|
623
671
|
type ProgramResult = {
|
|
624
672
|
ok: true;
|
|
@@ -636,4 +684,4 @@ type ProgramResult = {
|
|
|
636
684
|
*/
|
|
637
685
|
declare function emitQueryProgram(config: QueryToolConfig, format: QueryProgramFormat): ProgramResult;
|
|
638
686
|
//#endregion
|
|
639
|
-
export { type AttributeValue, type BuilderConfig, type CanonicalRequest, type DdbOperation, type DdbScalarType, FILTER_OPERATORS, type FilterDataType, type FilterOperatorOption, type FilterRow, type ItemAttr, KEY_OPERATORS, type KeyAttr, type KeyConditionResult, OPERATOR_BY_VALUE, type OperatorDef, type OperatorValue, type PartiqlResult, type PredicateExpression, type PredicatePrefix, type ProgramResult, type QueryProgramFormat, type QueryToolConfig, type RangeKeyCondition, SET_TYPES, type SetOperation, type SetType, type TypedValue, type UpdateAction, type UpdateActionKind, type UpdateExpressionResult, type WireFilterOperator, boto3MethodName, buildFilterExpressions, buildKeyConditionExpression, buildKeyMap, buildRequest, buildSdkV3Params, buildUpdateExpression, dotnetClientMethodName, dotnetRequestClassName, elementType, emitBoto3, emitCli, emitDdbToolboxProgram, emitDotnet, emitGo, emitJava, emitPartiql, emitQueryProgram, emitSdkV3, getCompatibleComparisonOperators, getCompatibleFilterOperators, goClientMethodName, goInputTypeName, hasBinaryValue, isSetType, javaClientMethodName, javaRequestClassName, makeTypedValue, renderJsValue, renderPyValue, sdkV3CommandName, typedMapToAvMap, typedValueToAv };
|
|
687
|
+
export { type AttributeValue, type BuilderConfig, type CanonicalRequest, type DdbOperation, type DdbScalarType, FILTER_OPERATORS, type FilterDataType, type FilterOperatorOption, type FilterRow, type ItemAttr, KEY_OPERATORS, type KeyAttr, type KeyConditionResult, OPERATOR_BY_VALUE, type OperatorDef, type OperatorValue, type PartiqlResult, type PredicateExpression, type PredicatePrefix, type ProgramResult, type QueryProgramFormat, type QueryToolConfig, type RangeKeyCondition, SET_TYPES, type SetOperation, type SetType, type TypedValue, type UpdateAction, type UpdateActionKind, type UpdateExpressionResult, type WireFilterOperator, boto3MethodName, buildFilterExpressions, buildKeyConditionExpression, buildKeyMap, buildRequest, buildSdkV3Params, buildUpdateExpression, docClientCommandName, dotnetClientMethodName, dotnetRequestClassName, elementType, emitBoto3, emitCli, emitDdbToolboxProgram, emitDocClient, emitDotnet, emitGo, emitJava, emitKotlin, emitPartiql, emitPhp, emitQueryProgram, emitRuby, emitRust, emitSdkV3, getCompatibleComparisonOperators, getCompatibleFilterOperators, goClientMethodName, goInputTypeName, hasBinaryValue, isSetType, javaClientMethodName, javaRequestClassName, kotlinClientMethodName, makeTypedValue, phpClientMethodName, renderJsValue, renderKotlinAv, renderPhpAv, renderPyValue, renderRubyValue, renderRustAv, rubyClientMethodName, rustClientMethodName, sdkV3CommandName, typedMapToAvMap, typedValueToAv };
|