presidium 3.4.1 → 3.4.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.
Files changed (2) hide show
  1. package/DynamoDBTable.js +106 -0
  2. package/package.json +1 -1
package/DynamoDBTable.js CHANGED
@@ -531,6 +531,7 @@ class DynamoDBTable {
531
531
  * ReturnConsumedCapacity: 'INDEXES'|'TOTAL'|'NONE',
532
532
  * ReturnItemCollectionMetrics: 'SIZE'|'NONE',
533
533
  * ReturnValues: 'NONE'|'ALL_OLD',
534
+ * ConditionExpression: string,
534
535
  * }) -> data Promise<{
535
536
  * Attributes: DynamoDBJSONObject,
536
537
  * ConsumedCapacity: {
@@ -548,6 +549,7 @@ class DynamoDBTable {
548
549
  * * `ReturnConsumedCapacity` - determines the level of detail about provisioned or on-demand throughput consumption that is returned in the response.
549
550
  * * `ReturnItemCollectionMetrics` - determines whether item collection metrics will be returned in the response.
550
551
  * * `ReturnValues` - includes the item attributes in DynamoDB JSON format in the response. The values returned are strongly consistent. There is no additional cost or read capacity units consumed when with requesting a return value aside from the incurred network overhead.
552
+ * * `ConditionExpression` - a condition that must be satisfied in order for a conditional update to succeed.
551
553
  *
552
554
  * Return:
553
555
  * * `data`
@@ -587,7 +589,58 @@ class DynamoDBTable {
587
589
  * })
588
590
  * ```
589
591
  *
592
+ * ### ConditionExpression Syntax
593
+ * ```sh [DynamoDB_ConditionExpression_Syntax]
594
+ * <attribute_name> = :<variable_name>
595
+ * <attribute_name> <> :<variable_name>
596
+ * <attribute_name> < :<variable_name>
597
+ * <attribute_name> <= :<variable_name>
598
+ * <attribute_name> > :<variable_name>
599
+ * <attribute_name> >= :<variable_name>
600
+ *
601
+ * <attribute_name> BETWEEN :<variable_name1> AND :<variable_name2>
602
+ *
603
+ * <attribute_name> IN (:<variable_name1>[, :<variable_name2>[, ...]])
604
+ *
605
+ * <function_name>(<attribute_name>[, :<variable_name>])
606
+ *
607
+ * <function_name>(<attribute_name>[, :<variable_name1>]) = :<variable_name2>
608
+ * <function_name>(<attribute_name>[, :<variable_name1>]) <> :<variable_name2>
609
+ * <function_name>(<attribute_name>[, :<variable_name1>]) < :<variable_name2>
610
+ * <function_name>(<attribute_name>[, :<variable_name1>]) <= :<variable_name2>
611
+ * <function_name>(<attribute_name>[, :<variable_name1>]) > :<variable_name2>
612
+ * <function_name>(<attribute_name>[, :<variable_name1>]) >= :<variable_name2>
613
+ *
614
+ * <expression> AND <expression>
615
+ *
616
+ * NOT <expression>
617
+ *
618
+ * (<expression>)
619
+ * ```
620
+ *
621
+ * `ConditionExpression` Functions:
622
+ * * `attribute_exists(<attribute_name>)` - test if `<attribute_name>` exists.
623
+ * * `attribute_not_exists(<attribute_name>)` - test if `<attribute_name>` does not exist.
624
+ * * `attribute_type(<attribute_name>, <attribute_type>)` - test if the DynamoDB attribute type of the DynamoDB attribute value of `<attribute_name>` equals `attribute_type`.
625
+ * * `contains(<attribute_name>, :<variable_name>)` - test if the DynamoDB attribute value of `<attribute_name>` equals the attribute value provided in `Updates` corresponding to `<variable_name>`.
626
+ * * `begins_with(<attribute_name>, :<variable_name>)` - test if the DynamoDB attribute value of `<attribute_name>` equals the attribute value provided in `Updates` corresponding to `<variable_name>`.
627
+ * * `size(<attribute_name>)` - returns for evaluation a number that represents the size of the attribute value of `<attribute_name>`
628
+ *
629
+ * `ConditionExpression` Logical Operators:
630
+ * * `=` - equals.
631
+ * * `<>` - does not equal.
632
+ * * `<` - less than.
633
+ * * `>` - greater than.
634
+ * * `<=` - less than or equal to .
635
+ * * `>=` - greater than or equal to.
636
+ * * `BETWEEN` - between.
637
+ * * `IN` - in.
638
+ * * `AND` - and.
639
+ * * `OR` - or.
640
+ * * `NOT` - not.
641
+ *
590
642
  * References:
643
+ * * [Condition Expressions](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.ConditionExpressions.html)
591
644
  * * [AWS DynamoDB](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Introduction.html)
592
645
  */
593
646
  async putItem(Item, options = {}) {
@@ -616,6 +669,7 @@ class DynamoDBTable {
616
669
  * ReturnConsumedCapacity: 'INDEXES'|'TOTAL'|'NONE',
617
670
  * ReturnItemCollectionMetrics: 'SIZE'|'NONE',
618
671
  * ReturnValues: 'NONE'|'ALL_OLD',
672
+ * ConditionExpression: string,
619
673
  * }) -> data Promise<{
620
674
  * AttributesJSON: JSONObject,
621
675
  * ConsumedCapacity: {
@@ -633,6 +687,7 @@ class DynamoDBTable {
633
687
  * * `ReturnConsumedCapacity` - determines the level of detail about provisioned or on-demand throughput consumption that is returned in the response.
634
688
  * * `ReturnItemCollectionMetrics` - determines whether item collection metrics will be returned in the response.
635
689
  * * `ReturnValues` - includes the item attributes in DynamoDB JSON format in the response. The values returned are strongly consistent. There is no additional cost or read capacity units consumed when with requesting a return value aside from the incurred network overhead.
690
+ * * `ConditionExpression` - a condition that must be satisfied in order for a conditional update to succeed.
636
691
  *
637
692
  * Return:
638
693
  * * `data`
@@ -672,7 +727,58 @@ class DynamoDBTable {
672
727
  * })
673
728
  * ```
674
729
  *
730
+ * ### ConditionExpression Syntax
731
+ * ```sh [DynamoDB_ConditionExpression_Syntax]
732
+ * <attribute_name> = :<variable_name>
733
+ * <attribute_name> <> :<variable_name>
734
+ * <attribute_name> < :<variable_name>
735
+ * <attribute_name> <= :<variable_name>
736
+ * <attribute_name> > :<variable_name>
737
+ * <attribute_name> >= :<variable_name>
738
+ *
739
+ * <attribute_name> BETWEEN :<variable_name1> AND :<variable_name2>
740
+ *
741
+ * <attribute_name> IN (:<variable_name1>[, :<variable_name2>[, ...]])
742
+ *
743
+ * <function_name>(<attribute_name>[, :<variable_name>])
744
+ *
745
+ * <function_name>(<attribute_name>[, :<variable_name1>]) = :<variable_name2>
746
+ * <function_name>(<attribute_name>[, :<variable_name1>]) <> :<variable_name2>
747
+ * <function_name>(<attribute_name>[, :<variable_name1>]) < :<variable_name2>
748
+ * <function_name>(<attribute_name>[, :<variable_name1>]) <= :<variable_name2>
749
+ * <function_name>(<attribute_name>[, :<variable_name1>]) > :<variable_name2>
750
+ * <function_name>(<attribute_name>[, :<variable_name1>]) >= :<variable_name2>
751
+ *
752
+ * <expression> AND <expression>
753
+ *
754
+ * NOT <expression>
755
+ *
756
+ * (<expression>)
757
+ * ```
758
+ *
759
+ * `ConditionExpression` Functions:
760
+ * * `attribute_exists(<attribute_name>)` - test if `<attribute_name>` exists.
761
+ * * `attribute_not_exists(<attribute_name>)` - test if `<attribute_name>` does not exist.
762
+ * * `attribute_type(<attribute_name>, <attribute_type>)` - test if the DynamoDB attribute type of the DynamoDB attribute value of `<attribute_name>` equals `attribute_type`.
763
+ * * `contains(<attribute_name>, :<variable_name>)` - test if the DynamoDB attribute value of `<attribute_name>` equals the attribute value provided in `Updates` corresponding to `<variable_name>`.
764
+ * * `begins_with(<attribute_name>, :<variable_name>)` - test if the DynamoDB attribute value of `<attribute_name>` equals the attribute value provided in `Updates` corresponding to `<variable_name>`.
765
+ * * `size(<attribute_name>)` - returns for evaluation a number that represents the size of the attribute value of `<attribute_name>`
766
+ *
767
+ * `ConditionExpression` Logical Operators:
768
+ * * `=` - equals.
769
+ * * `<>` - does not equal.
770
+ * * `<` - less than.
771
+ * * `>` - greater than.
772
+ * * `<=` - less than or equal to .
773
+ * * `>=` - greater than or equal to.
774
+ * * `BETWEEN` - between.
775
+ * * `IN` - in.
776
+ * * `AND` - and.
777
+ * * `OR` - or.
778
+ * * `NOT` - not.
779
+ *
675
780
  * References:
781
+ * * [Condition Expressions](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.ConditionExpressions.html)
676
782
  * * [AWS DynamoDB](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Introduction.html)
677
783
  */
678
784
  async putItemJSON(item, options = {}) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "presidium",
3
- "version": "3.4.1",
3
+ "version": "3.4.3",
4
4
  "description": "A library for creating web services",
5
5
  "author": "Richard Tong",
6
6
  "license": "MIT",