@squiz/db-lib 1.71.2 → 1.72.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +19 -0
- package/lib/AbstractRepository.d.ts +2 -0
- package/lib/AbstractRepository.d.ts.map +1 -0
- package/lib/AbstractRepository.integration.spec.d.ts +1 -0
- package/lib/AbstractRepository.integration.spec.d.ts.map +1 -0
- package/lib/AbstractRepository.integration.spec.js +118 -0
- package/lib/AbstractRepository.integration.spec.js.map +1 -0
- package/lib/AbstractRepository.js +187 -0
- package/lib/AbstractRepository.js.map +1 -0
- package/lib/ConnectionManager.d.ts +1 -0
- package/lib/ConnectionManager.d.ts.map +1 -0
- package/lib/ConnectionManager.js +58 -0
- package/lib/ConnectionManager.js.map +1 -0
- package/lib/Migrator.d.ts +1 -0
- package/lib/Migrator.d.ts.map +1 -0
- package/lib/Migrator.js +160 -0
- package/lib/Migrator.js.map +1 -0
- package/lib/PostgresErrorCodes.d.ts +1 -0
- package/lib/PostgresErrorCodes.d.ts.map +1 -0
- package/lib/PostgresErrorCodes.js +274 -0
- package/lib/PostgresErrorCodes.js.map +1 -0
- package/lib/Repositories.d.ts +1 -0
- package/lib/Repositories.d.ts.map +1 -0
- package/lib/Repositories.js +3 -0
- package/lib/Repositories.js.map +1 -0
- package/lib/dynamodb/AbstractDynamoDbRepository.d.ts +50 -9
- package/lib/dynamodb/AbstractDynamoDbRepository.d.ts.map +1 -0
- package/lib/dynamodb/AbstractDynamoDbRepository.js +456 -0
- package/lib/dynamodb/AbstractDynamoDbRepository.js.map +1 -0
- package/lib/dynamodb/AbstractDynamoDbRepository.spec.d.ts +1 -0
- package/lib/dynamodb/AbstractDynamoDbRepository.spec.d.ts.map +1 -0
- package/lib/dynamodb/AbstractDynamoDbRepository.spec.js +924 -0
- package/lib/dynamodb/AbstractDynamoDbRepository.spec.js.map +1 -0
- package/lib/dynamodb/DynamoDbManager.d.ts +1 -0
- package/lib/dynamodb/DynamoDbManager.d.ts.map +1 -0
- package/lib/dynamodb/DynamoDbManager.js +66 -0
- package/lib/dynamodb/DynamoDbManager.js.map +1 -0
- package/lib/dynamodb/getDynamoDbOptions.d.ts +1 -0
- package/lib/dynamodb/getDynamoDbOptions.d.ts.map +1 -0
- package/lib/dynamodb/getDynamoDbOptions.js +15 -0
- package/lib/dynamodb/getDynamoDbOptions.js.map +1 -0
- package/lib/error/DuplicateItemError.d.ts +1 -0
- package/lib/error/DuplicateItemError.d.ts.map +1 -0
- package/lib/error/DuplicateItemError.js +12 -0
- package/lib/error/DuplicateItemError.js.map +1 -0
- package/lib/error/InvalidDataFormatError.d.ts +1 -0
- package/lib/error/InvalidDataFormatError.d.ts.map +1 -0
- package/lib/error/InvalidDataFormatError.js +12 -0
- package/lib/error/InvalidDataFormatError.js.map +1 -0
- package/lib/error/InvalidDbSchemaError.d.ts +1 -0
- package/lib/error/InvalidDbSchemaError.d.ts.map +1 -0
- package/lib/error/InvalidDbSchemaError.js +12 -0
- package/lib/error/InvalidDbSchemaError.js.map +1 -0
- package/lib/error/MissingKeyValuesError.d.ts +1 -0
- package/lib/error/MissingKeyValuesError.d.ts.map +1 -0
- package/lib/error/MissingKeyValuesError.js +12 -0
- package/lib/error/MissingKeyValuesError.js.map +1 -0
- package/lib/error/TransactionError.d.ts +1 -0
- package/lib/error/TransactionError.d.ts.map +1 -0
- package/lib/error/TransactionError.js +12 -0
- package/lib/error/TransactionError.js.map +1 -0
- package/lib/getConnectionInfo.d.ts +1 -0
- package/lib/getConnectionInfo.d.ts.map +1 -0
- package/lib/getConnectionInfo.js +30 -0
- package/lib/getConnectionInfo.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +33 -70416
- package/lib/index.js.map +1 -7
- package/package.json +5 -5
- package/src/AbstractRepository.ts +26 -20
- package/src/dynamodb/AbstractDynamoDbRepository.spec.ts +289 -37
- package/src/dynamodb/AbstractDynamoDbRepository.ts +140 -31
- package/src/dynamodb/getDynamoDbOptions.ts +1 -1
- package/tsconfig.json +5 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/build.js +0 -31
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"PostgresErrorCodes.d.ts","sourceRoot":"","sources":["../src/PostgresErrorCodes.ts"],"names":[],"mappings":"AAEA,oBAAY,iBAAiB;IAC3B,qBAAqB,UAAU;IAC/B,OAAO,UAAU;IACjB,oCAAoC,UAAU;IAC9C,iCAAiC,UAAU;IAC3C,6CAA6C,UAAU;IACvD,6BAA6B,UAAU;IACvC,6BAA6B,UAAU;IACvC,oCAAoC,UAAU;IAC9C,0BAA0B,UAAU;IACpC,OAAO,UAAU;IACjB,0CAA0C,UAAU;IACpD,8BAA8B,UAAU;IACxC,oBAAoB,UAAU;IAC9B,yBAAyB,UAAU;IACnC,kBAAkB,UAAU;IAC5B,2CAA2C,UAAU;IACrD,iDAAiD,UAAU;IAC3D,8BAA8B,UAAU;IACxC,kBAAkB,UAAU;IAC5B,0BAA0B,UAAU;IACpC,qBAAqB,UAAU;IAC/B,8BAA8B,UAAU;IACxC,iBAAiB,UAAU;IAC3B,yBAAyB,UAAU;IACnC,eAAe,UAAU;IACzB,uBAAuB,UAAU;IACjC,0BAA0B,UAAU;IACpC,qBAAqB,UAAU;IAC/B,mDAAmD,UAAU;IAC7D,cAAc,UAAU;IACxB,qBAAqB,UAAU;IAC/B,cAAc,UAAU;IACxB,mBAAmB,UAAU;IAC7B,qBAAqB,UAAU;IAC/B,2BAA2B,UAAU;IACrC,uBAAuB,UAAU;IACjC,2BAA2B,UAAU;IACrC,gBAAgB,UAAU;IAC1B,mBAAmB,UAAU;IAC7B,yBAAyB,UAAU;IACnC,kBAAkB,UAAU;IAC5B,uBAAuB,UAAU;IACjC,wBAAwB,UAAU;IAClC,0BAA0B,UAAU;IACpC,8BAA8B,UAAU;IACxC,mCAAmC,UAAU;IAC7C,0CAA0C,UAAU;IACpD,gCAAgC,UAAU;IAC1C,uBAAuB,UAAU;IACjC,wBAAwB,UAAU;IAClC,oBAAoB,UA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AAiB,UAAU;IAC3B,gBAAgB,UAAU;IAC1B,SAAS,UAAU;IACnB,yBAAyB,UAAU;IACnC,kCAAkC,UAAU;IAC5C,2BAA2B,UAAU;IACrC,uCAAuC,UAAU;IACjD,2BAA2B,UAAU;IACrC,uBAAuB,UAAU;IACjC,yBAAyB,UAAU;IACnC,qBAAqB,UAAU;IAC/B,iCAAiC,UAAU;IAC3C,uCAAuC,UAAU;IACjD,kBAAkB,UAAU;IAC5B,wBAAwB,UAAU;IAClC,uBAAuB,UAAU;IACjC,0CAA0C,UAAU;IACpD,yBAAyB,UAAU;IACnC,+BAA+B,UAAU;IACzC,oBAAoB,UAAU;IAC9B,iBAAiB,UAAU;IAC3B,cAAc,UAAU;IACxB,yBAAyB,UAAU;IACnC,gBAAgB,UAAU;IAC1B,oBAAoB,UAAU;IAC9B,mBAAmB,UAAU;IAC7B,8BAA8B,UAAU;IACxC,0BAA0B,UAAU;IACpC,kCAAkC,UAAU;IAC5C,aAAa,UAAU;IACvB,eAAe,UAAU;IACzB,aAAa,UAAU;IACvB,aAAa,UAAU;IACvB,cAAc,UAAU;IACxB,cAAc,UAAU;IACxB,cAAc,UAAU;IACxB,eAAe,UAAU;CAC1B"}
|
@@ -0,0 +1,274 @@
|
|
1
|
+
"use strict";
|
2
|
+
// See https://github.com/postgres/postgres/blob/master/src/backend/utils/errcodes.txt
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.PostgresErrorCode = void 0;
|
5
|
+
var PostgresErrorCode;
|
6
|
+
(function (PostgresErrorCode) {
|
7
|
+
PostgresErrorCode["SUCCESSFUL_COMPLETION"] = "00000";
|
8
|
+
PostgresErrorCode["WARNING"] = "01000";
|
9
|
+
PostgresErrorCode["WARNING_DYNAMIC_RESULT_SETS_RETURNED"] = "0100C";
|
10
|
+
PostgresErrorCode["WARNING_IMPLICIT_ZERO_BIT_PADDING"] = "01008";
|
11
|
+
PostgresErrorCode["WARNING_NULL_VALUE_ELIMINATED_IN_SET_FUNCTION"] = "01003";
|
12
|
+
PostgresErrorCode["WARNING_PRIVILEGE_NOT_GRANTED"] = "01007";
|
13
|
+
PostgresErrorCode["WARNING_PRIVILEGE_NOT_REVOKED"] = "01006";
|
14
|
+
PostgresErrorCode["WARNING_STRING_DATA_RIGHT_TRUNCATION"] = "01004";
|
15
|
+
PostgresErrorCode["WARNING_DEPRECATED_FEATURE"] = "01P01";
|
16
|
+
PostgresErrorCode["NO_DATA"] = "02000";
|
17
|
+
PostgresErrorCode["NO_ADDITIONAL_DYNAMIC_RESULT_SETS_RETURNED"] = "02001";
|
18
|
+
PostgresErrorCode["SQL_STATEMENT_NOT_YET_COMPLETE"] = "03000";
|
19
|
+
PostgresErrorCode["CONNECTION_EXCEPTION"] = "08000";
|
20
|
+
PostgresErrorCode["CONNECTION_DOES_NOT_EXIST"] = "08003";
|
21
|
+
PostgresErrorCode["CONNECTION_FAILURE"] = "08006";
|
22
|
+
PostgresErrorCode["SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION"] = "08001";
|
23
|
+
PostgresErrorCode["SQLSERVER_REJECTED_ESTABLISHMENT_OF_SQLCONNECTION"] = "08004";
|
24
|
+
PostgresErrorCode["TRANSACTION_RESOLUTION_UNKNOWN"] = "08007";
|
25
|
+
PostgresErrorCode["PROTOCOL_VIOLATION"] = "08P01";
|
26
|
+
PostgresErrorCode["TRIGGERED_ACTION_EXCEPTION"] = "09000";
|
27
|
+
PostgresErrorCode["FEATURE_NOT_SUPPORTED"] = "0A000";
|
28
|
+
PostgresErrorCode["INVALID_TRANSACTION_INITIATION"] = "0B000";
|
29
|
+
PostgresErrorCode["LOCATOR_EXCEPTION"] = "0F000";
|
30
|
+
PostgresErrorCode["L_E_INVALID_SPECIFICATION"] = "0F001";
|
31
|
+
PostgresErrorCode["INVALID_GRANTOR"] = "0L000";
|
32
|
+
PostgresErrorCode["INVALID_GRANT_OPERATION"] = "0LP01";
|
33
|
+
PostgresErrorCode["INVALID_ROLE_SPECIFICATION"] = "0P000";
|
34
|
+
PostgresErrorCode["DIAGNOSTICS_EXCEPTION"] = "0Z000";
|
35
|
+
PostgresErrorCode["STACKED_DIAGNOSTICS_ACCESSED_WITHOUT_ACTIVE_HANDLER"] = "0Z002";
|
36
|
+
PostgresErrorCode["CASE_NOT_FOUND"] = "20000";
|
37
|
+
PostgresErrorCode["CARDINALITY_VIOLATION"] = "21000";
|
38
|
+
PostgresErrorCode["DATA_EXCEPTION"] = "22000";
|
39
|
+
PostgresErrorCode["ARRAY_ELEMENT_ERROR"] = "2202E";
|
40
|
+
PostgresErrorCode["ARRAY_SUBSCRIPT_ERROR"] = "2202E";
|
41
|
+
PostgresErrorCode["CHARACTER_NOT_IN_REPERTOIRE"] = "22021";
|
42
|
+
PostgresErrorCode["DATETIME_FIELD_OVERFLOW"] = "22008";
|
43
|
+
PostgresErrorCode["DATETIME_VALUE_OUT_OF_RANGE"] = "22008";
|
44
|
+
PostgresErrorCode["DIVISION_BY_ZERO"] = "22012";
|
45
|
+
PostgresErrorCode["ERROR_IN_ASSIGNMENT"] = "22005";
|
46
|
+
PostgresErrorCode["ESCAPE_CHARACTER_CONFLICT"] = "2200B";
|
47
|
+
PostgresErrorCode["INDICATOR_OVERFLOW"] = "22022";
|
48
|
+
PostgresErrorCode["INTERVAL_FIELD_OVERFLOW"] = "22015";
|
49
|
+
PostgresErrorCode["INVALID_ARGUMENT_FOR_LOG"] = "2201E";
|
50
|
+
PostgresErrorCode["INVALID_ARGUMENT_FOR_NTILE"] = "22014";
|
51
|
+
PostgresErrorCode["INVALID_ARGUMENT_FOR_NTH_VALUE"] = "22016";
|
52
|
+
PostgresErrorCode["INVALID_ARGUMENT_FOR_POWER_FUNCTION"] = "2201F";
|
53
|
+
PostgresErrorCode["INVALID_ARGUMENT_FOR_WIDTH_BUCKET_FUNCTION"] = "2201G";
|
54
|
+
PostgresErrorCode["INVALID_CHARACTER_VALUE_FOR_CAST"] = "22018";
|
55
|
+
PostgresErrorCode["INVALID_DATETIME_FORMAT"] = "22007";
|
56
|
+
PostgresErrorCode["INVALID_ESCAPE_CHARACTER"] = "22019";
|
57
|
+
PostgresErrorCode["INVALID_ESCAPE_OCTET"] = "2200D";
|
58
|
+
PostgresErrorCode["INVALID_ESCAPE_SEQUENCE"] = "22025";
|
59
|
+
PostgresErrorCode["NONSTANDARD_USE_OF_ESCAPE_CHARACTER"] = "22P06";
|
60
|
+
PostgresErrorCode["INVALID_INDICATOR_PARAMETER_VALUE"] = "22010";
|
61
|
+
PostgresErrorCode["INVALID_PARAMETER_VALUE"] = "22023";
|
62
|
+
PostgresErrorCode["INVALID_PRECEDING_OR_FOLLOWING_SIZE"] = "22013";
|
63
|
+
PostgresErrorCode["INVALID_REGULAR_EXPRESSION"] = "2201B";
|
64
|
+
PostgresErrorCode["INVALID_ROW_COUNT_IN_LIMIT_CLAUSE"] = "2201W";
|
65
|
+
PostgresErrorCode["INVALID_ROW_COUNT_IN_RESULT_OFFSET_CLAUSE"] = "2201X";
|
66
|
+
PostgresErrorCode["INVALID_TABLESAMPLE_ARGUMENT"] = "2202H";
|
67
|
+
PostgresErrorCode["INVALID_TABLESAMPLE_REPEAT"] = "2202G";
|
68
|
+
PostgresErrorCode["INVALID_TIME_ZONE_DISPLACEMENT_VALUE"] = "22009";
|
69
|
+
PostgresErrorCode["INVALID_USE_OF_ESCAPE_CHARACTER"] = "2200C";
|
70
|
+
PostgresErrorCode["MOST_SPECIFIC_TYPE_MISMATCH"] = "2200G";
|
71
|
+
PostgresErrorCode["NULL_VALUE_NOT_ALLOWED"] = "22004";
|
72
|
+
PostgresErrorCode["NULL_VALUE_NO_INDICATOR_PARAMETER"] = "22002";
|
73
|
+
PostgresErrorCode["NUMERIC_VALUE_OUT_OF_RANGE"] = "22003";
|
74
|
+
PostgresErrorCode["SEQUENCE_GENERATOR_LIMIT_EXCEEDED"] = "2200H";
|
75
|
+
PostgresErrorCode["STRING_DATA_LENGTH_MISMATCH"] = "22026";
|
76
|
+
PostgresErrorCode["STRING_DATA_RIGHT_TRUNCATION"] = "22001";
|
77
|
+
PostgresErrorCode["SUBSTRING_ERROR"] = "22011";
|
78
|
+
PostgresErrorCode["TRIM_ERROR"] = "22027";
|
79
|
+
PostgresErrorCode["UNTERMINATED_C_STRING"] = "22024";
|
80
|
+
PostgresErrorCode["ZERO_LENGTH_CHARACTER_STRING"] = "2200F";
|
81
|
+
PostgresErrorCode["FLOATING_POINT_EXCEPTION"] = "22P01";
|
82
|
+
PostgresErrorCode["INVALID_TEXT_REPRESENTATION"] = "22P02";
|
83
|
+
PostgresErrorCode["INVALID_BINARY_REPRESENTATION"] = "22P03";
|
84
|
+
PostgresErrorCode["BAD_COPY_FILE_FORMAT"] = "22P04";
|
85
|
+
PostgresErrorCode["UNTRANSLATABLE_CHARACTER"] = "22P05";
|
86
|
+
PostgresErrorCode["NOT_AN_XML_DOCUMENT"] = "2200L";
|
87
|
+
PostgresErrorCode["INVALID_XML_DOCUMENT"] = "2200M";
|
88
|
+
PostgresErrorCode["INVALID_XML_CONTENT"] = "2200N";
|
89
|
+
PostgresErrorCode["INVALID_XML_COMMENT"] = "2200S";
|
90
|
+
PostgresErrorCode["INVALID_XML_PROCESSING_INSTRUCTION"] = "2200T";
|
91
|
+
PostgresErrorCode["DUPLICATE_JSON_OBJECT_KEY_VALUE"] = "22030";
|
92
|
+
PostgresErrorCode["INVALID_ARGUMENT_FOR_SQL_JSON_DATETIME_FUNCTION"] = "22031";
|
93
|
+
PostgresErrorCode["INVALID_JSON_TEXT"] = "22032";
|
94
|
+
PostgresErrorCode["INVALID_SQL_JSON_SUBSCRIPT"] = "22033";
|
95
|
+
PostgresErrorCode["MORE_THAN_ONE_SQL_JSON_ITEM"] = "22034";
|
96
|
+
PostgresErrorCode["NO_SQL_JSON_ITEM"] = "22035";
|
97
|
+
PostgresErrorCode["NON_NUMERIC_SQL_JSON_ITEM"] = "22036";
|
98
|
+
PostgresErrorCode["NON_UNIQUE_KEYS_IN_A_JSON_OBJECT"] = "22037";
|
99
|
+
PostgresErrorCode["SINGLETON_SQL_JSON_ITEM_REQUIRED"] = "22038";
|
100
|
+
PostgresErrorCode["SQL_JSON_ARRAY_NOT_FOUND"] = "22039";
|
101
|
+
PostgresErrorCode["SQL_JSON_MEMBER_NOT_FOUND"] = "2203A";
|
102
|
+
PostgresErrorCode["SQL_JSON_NUMBER_NOT_FOUND"] = "2203B";
|
103
|
+
PostgresErrorCode["SQL_JSON_OBJECT_NOT_FOUND"] = "2203C";
|
104
|
+
PostgresErrorCode["TOO_MANY_JSON_ARRAY_ELEMENTS"] = "2203D";
|
105
|
+
PostgresErrorCode["TOO_MANY_JSON_OBJECT_MEMBERS"] = "2203E";
|
106
|
+
PostgresErrorCode["SQL_JSON_SCALAR_REQUIRED"] = "2203F";
|
107
|
+
PostgresErrorCode["SQL_JSON_ITEM_CANNOT_BE_CAST_TO_TARGET_TYPE"] = "2203G";
|
108
|
+
PostgresErrorCode["INTEGRITY_CONSTRAINT_VIOLATION"] = "23000";
|
109
|
+
PostgresErrorCode["RESTRICT_VIOLATION"] = "23001";
|
110
|
+
PostgresErrorCode["NOT_NULL_VIOLATION"] = "23502";
|
111
|
+
PostgresErrorCode["FOREIGN_KEY_VIOLATION"] = "23503";
|
112
|
+
PostgresErrorCode["UNIQUE_VIOLATION"] = "23505";
|
113
|
+
PostgresErrorCode["CHECK_VIOLATION"] = "23514";
|
114
|
+
PostgresErrorCode["EXCLUSION_VIOLATION"] = "23P01";
|
115
|
+
PostgresErrorCode["INVALID_CURSOR_STATE"] = "24000";
|
116
|
+
PostgresErrorCode["INVALID_TRANSACTION_STATE"] = "25000";
|
117
|
+
PostgresErrorCode["ACTIVE_SQL_TRANSACTION"] = "25001";
|
118
|
+
PostgresErrorCode["BRANCH_TRANSACTION_ALREADY_ACTIVE"] = "25002";
|
119
|
+
PostgresErrorCode["HELD_CURSOR_REQUIRES_SAME_ISOLATION_LEVEL"] = "25008";
|
120
|
+
PostgresErrorCode["INAPPROPRIATE_ACCESS_MODE_FOR_BRANCH_TRANSACTION"] = "25003";
|
121
|
+
PostgresErrorCode["INAPPROPRIATE_ISOLATION_LEVEL_FOR_BRANCH_TRANSACTION"] = "25004";
|
122
|
+
PostgresErrorCode["NO_ACTIVE_SQL_TRANSACTION_FOR_BRANCH_TRANSACTION"] = "25005";
|
123
|
+
PostgresErrorCode["READ_ONLY_SQL_TRANSACTION"] = "25006";
|
124
|
+
PostgresErrorCode["SCHEMA_AND_DATA_STATEMENT_MIXING_NOT_SUPPORTED"] = "25007";
|
125
|
+
PostgresErrorCode["NO_ACTIVE_SQL_TRANSACTION"] = "25P01";
|
126
|
+
PostgresErrorCode["IN_FAILED_SQL_TRANSACTION"] = "25P02";
|
127
|
+
PostgresErrorCode["IDLE_IN_TRANSACTION_SESSION_TIMEOUT"] = "25P03";
|
128
|
+
PostgresErrorCode["INVALID_SQL_STATEMENT_NAME"] = "26000";
|
129
|
+
PostgresErrorCode["TRIGGERED_DATA_CHANGE_VIOLATION"] = "27000";
|
130
|
+
PostgresErrorCode["INVALID_AUTHORIZATION_SPECIFICATION"] = "28000";
|
131
|
+
PostgresErrorCode["INVALID_PASSWORD"] = "28P01";
|
132
|
+
PostgresErrorCode["DEPENDENT_PRIVILEGE_DESCRIPTORS_STILL_EXIST"] = "2B000";
|
133
|
+
PostgresErrorCode["DEPENDENT_OBJECTS_STILL_EXIST"] = "2BP01";
|
134
|
+
PostgresErrorCode["INVALID_TRANSACTION_TERMINATION"] = "2D000";
|
135
|
+
PostgresErrorCode["SQL_ROUTINE_EXCEPTION"] = "2F000";
|
136
|
+
PostgresErrorCode["S_R_E_FUNCTION_EXECUTED_NO_RETURN_STATEMENT"] = "2F005";
|
137
|
+
PostgresErrorCode["S_R_E_MODIFYING_SQL_DATA_NOT_PERMITTED"] = "2F002";
|
138
|
+
PostgresErrorCode["S_R_E_PROHIBITED_SQL_STATEMENT_ATTEMPTED"] = "2F003";
|
139
|
+
PostgresErrorCode["S_R_E_READING_SQL_DATA_NOT_PERMITTED"] = "2F004";
|
140
|
+
PostgresErrorCode["INVALID_CURSOR_NAME"] = "34000";
|
141
|
+
PostgresErrorCode["EXTERNAL_ROUTINE_EXCEPTION"] = "38000";
|
142
|
+
PostgresErrorCode["E_R_E_CONTAINING_SQL_NOT_PERMITTED"] = "38001";
|
143
|
+
PostgresErrorCode["E_R_E_MODIFYING_SQL_DATA_NOT_PERMITTED"] = "38002";
|
144
|
+
PostgresErrorCode["E_R_E_PROHIBITED_SQL_STATEMENT_ATTEMPTED"] = "38003";
|
145
|
+
PostgresErrorCode["E_R_E_READING_SQL_DATA_NOT_PERMITTED"] = "38004";
|
146
|
+
PostgresErrorCode["EXTERNAL_ROUTINE_INVOCATION_EXCEPTION"] = "39000";
|
147
|
+
PostgresErrorCode["E_R_I_E_INVALID_SQLSTATE_RETURNED"] = "39001";
|
148
|
+
PostgresErrorCode["E_R_I_E_NULL_VALUE_NOT_ALLOWED"] = "39004";
|
149
|
+
PostgresErrorCode["E_R_I_E_TRIGGER_PROTOCOL_VIOLATED"] = "39P01";
|
150
|
+
PostgresErrorCode["E_R_I_E_SRF_PROTOCOL_VIOLATED"] = "39P02";
|
151
|
+
PostgresErrorCode["E_R_I_E_EVENT_TRIGGER_PROTOCOL_VIOLATED"] = "39P03";
|
152
|
+
PostgresErrorCode["SAVEPOINT_EXCEPTION"] = "3B000";
|
153
|
+
PostgresErrorCode["S_E_INVALID_SPECIFICATION"] = "3B001";
|
154
|
+
PostgresErrorCode["INVALID_CATALOG_NAME"] = "3D000";
|
155
|
+
PostgresErrorCode["INVALID_SCHEMA_NAME"] = "3F000";
|
156
|
+
PostgresErrorCode["TRANSACTION_ROLLBACK"] = "40000";
|
157
|
+
PostgresErrorCode["T_R_INTEGRITY_CONSTRAINT_VIOLATION"] = "40002";
|
158
|
+
PostgresErrorCode["T_R_SERIALIZATION_FAILURE"] = "40001";
|
159
|
+
PostgresErrorCode["T_R_STATEMENT_COMPLETION_UNKNOWN"] = "40003";
|
160
|
+
PostgresErrorCode["T_R_DEADLOCK_DETECTED"] = "40P01";
|
161
|
+
PostgresErrorCode["SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATION"] = "42000";
|
162
|
+
PostgresErrorCode["SYNTAX_ERROR"] = "42601";
|
163
|
+
PostgresErrorCode["INSUFFICIENT_PRIVILEGE"] = "42501";
|
164
|
+
PostgresErrorCode["CANNOT_COERCE"] = "42846";
|
165
|
+
PostgresErrorCode["GROUPING_ERROR"] = "42803";
|
166
|
+
PostgresErrorCode["WINDOWING_ERROR"] = "42P20";
|
167
|
+
PostgresErrorCode["INVALID_RECURSION"] = "42P19";
|
168
|
+
PostgresErrorCode["INVALID_FOREIGN_KEY"] = "42830";
|
169
|
+
PostgresErrorCode["INVALID_NAME"] = "42602";
|
170
|
+
PostgresErrorCode["NAME_TOO_LONG"] = "42622";
|
171
|
+
PostgresErrorCode["RESERVED_NAME"] = "42939";
|
172
|
+
PostgresErrorCode["DATATYPE_MISMATCH"] = "42804";
|
173
|
+
PostgresErrorCode["INDETERMINATE_DATATYPE"] = "42P18";
|
174
|
+
PostgresErrorCode["COLLATION_MISMATCH"] = "42P21";
|
175
|
+
PostgresErrorCode["INDETERMINATE_COLLATION"] = "42P22";
|
176
|
+
PostgresErrorCode["WRONG_OBJECT_TYPE"] = "42809";
|
177
|
+
PostgresErrorCode["GENERATED_ALWAYS"] = "428C9";
|
178
|
+
PostgresErrorCode["UNDEFINED_COLUMN"] = "42703";
|
179
|
+
PostgresErrorCode["UNDEFINED_CURSOR"] = "34000";
|
180
|
+
PostgresErrorCode["UNDEFINED_DATABASE"] = "3D000";
|
181
|
+
PostgresErrorCode["UNDEFINED_FUNCTION"] = "42883";
|
182
|
+
PostgresErrorCode["UNDEFINED_PSTATEMENT"] = "26000";
|
183
|
+
PostgresErrorCode["UNDEFINED_SCHEMA"] = "3F000";
|
184
|
+
PostgresErrorCode["UNDEFINED_TABLE"] = "42P01";
|
185
|
+
PostgresErrorCode["UNDEFINED_PARAMETER"] = "42P02";
|
186
|
+
PostgresErrorCode["UNDEFINED_OBJECT"] = "42704";
|
187
|
+
PostgresErrorCode["DUPLICATE_COLUMN"] = "42701";
|
188
|
+
PostgresErrorCode["DUPLICATE_CURSOR"] = "42P03";
|
189
|
+
PostgresErrorCode["DUPLICATE_DATABASE"] = "42P04";
|
190
|
+
PostgresErrorCode["DUPLICATE_FUNCTION"] = "42723";
|
191
|
+
PostgresErrorCode["DUPLICATE_PSTATEMENT"] = "42P05";
|
192
|
+
PostgresErrorCode["DUPLICATE_SCHEMA"] = "42P06";
|
193
|
+
PostgresErrorCode["DUPLICATE_TABLE"] = "42P07";
|
194
|
+
PostgresErrorCode["DUPLICATE_ALIAS"] = "42712";
|
195
|
+
PostgresErrorCode["DUPLICATE_OBJECT"] = "42710";
|
196
|
+
PostgresErrorCode["AMBIGUOUS_COLUMN"] = "42702";
|
197
|
+
PostgresErrorCode["AMBIGUOUS_FUNCTION"] = "42725";
|
198
|
+
PostgresErrorCode["AMBIGUOUS_PARAMETER"] = "42P08";
|
199
|
+
PostgresErrorCode["AMBIGUOUS_ALIAS"] = "42P09";
|
200
|
+
PostgresErrorCode["INVALID_COLUMN_REFERENCE"] = "42P10";
|
201
|
+
PostgresErrorCode["INVALID_COLUMN_DEFINITION"] = "42611";
|
202
|
+
PostgresErrorCode["INVALID_CURSOR_DEFINITION"] = "42P11";
|
203
|
+
PostgresErrorCode["INVALID_DATABASE_DEFINITION"] = "42P12";
|
204
|
+
PostgresErrorCode["INVALID_FUNCTION_DEFINITION"] = "42P13";
|
205
|
+
PostgresErrorCode["INVALID_PSTATEMENT_DEFINITION"] = "42P14";
|
206
|
+
PostgresErrorCode["INVALID_SCHEMA_DEFINITION"] = "42P15";
|
207
|
+
PostgresErrorCode["INVALID_TABLE_DEFINITION"] = "42P16";
|
208
|
+
PostgresErrorCode["INVALID_OBJECT_DEFINITION"] = "42P17";
|
209
|
+
PostgresErrorCode["WITH_CHECK_OPTION_VIOLATION"] = "44000";
|
210
|
+
PostgresErrorCode["INSUFFICIENT_RESOURCES"] = "53000";
|
211
|
+
PostgresErrorCode["DISK_FULL"] = "53100";
|
212
|
+
PostgresErrorCode["OUT_OF_MEMORY"] = "53200";
|
213
|
+
PostgresErrorCode["TOO_MANY_CONNECTIONS"] = "53300";
|
214
|
+
PostgresErrorCode["CONFIGURATION_LIMIT_EXCEEDED"] = "53400";
|
215
|
+
PostgresErrorCode["PROGRAM_LIMIT_EXCEEDED"] = "54000";
|
216
|
+
PostgresErrorCode["STATEMENT_TOO_COMPLEX"] = "54001";
|
217
|
+
PostgresErrorCode["TOO_MANY_COLUMNS"] = "54011";
|
218
|
+
PostgresErrorCode["TOO_MANY_ARGUMENTS"] = "54023";
|
219
|
+
PostgresErrorCode["OBJECT_NOT_IN_PREREQUISITE_STATE"] = "55000";
|
220
|
+
PostgresErrorCode["OBJECT_IN_USE"] = "55006";
|
221
|
+
PostgresErrorCode["CANT_CHANGE_RUNTIME_PARAM"] = "55P02";
|
222
|
+
PostgresErrorCode["LOCK_NOT_AVAILABLE"] = "55P03";
|
223
|
+
PostgresErrorCode["UNSAFE_NEW_ENUM_VALUE_USAGE"] = "55P04";
|
224
|
+
PostgresErrorCode["OPERATOR_INTERVENTION"] = "57000";
|
225
|
+
PostgresErrorCode["QUERY_CANCELED"] = "57014";
|
226
|
+
PostgresErrorCode["ADMIN_SHUTDOWN"] = "57P01";
|
227
|
+
PostgresErrorCode["CRASH_SHUTDOWN"] = "57P02";
|
228
|
+
PostgresErrorCode["CANNOT_CONNECT_NOW"] = "57P03";
|
229
|
+
PostgresErrorCode["DATABASE_DROPPED"] = "57P04";
|
230
|
+
PostgresErrorCode["IDLE_SESSION_TIMEOUT"] = "57P05";
|
231
|
+
PostgresErrorCode["SYSTEM_ERROR"] = "58000";
|
232
|
+
PostgresErrorCode["IO_ERROR"] = "58030";
|
233
|
+
PostgresErrorCode["UNDEFINED_FILE"] = "58P01";
|
234
|
+
PostgresErrorCode["DUPLICATE_FILE"] = "58P02";
|
235
|
+
PostgresErrorCode["SNAPSHOT_TOO_OLD"] = "72000";
|
236
|
+
PostgresErrorCode["CONFIG_FILE_ERROR"] = "F0000";
|
237
|
+
PostgresErrorCode["LOCK_FILE_EXISTS"] = "F0001";
|
238
|
+
PostgresErrorCode["FDW_ERROR"] = "HV000";
|
239
|
+
PostgresErrorCode["FDW_COLUMN_NAME_NOT_FOUND"] = "HV005";
|
240
|
+
PostgresErrorCode["FDW_DYNAMIC_PARAMETER_VALUE_NEEDED"] = "HV002";
|
241
|
+
PostgresErrorCode["FDW_FUNCTION_SEQUENCE_ERROR"] = "HV010";
|
242
|
+
PostgresErrorCode["FDW_INCONSISTENT_DESCRIPTOR_INFORMATION"] = "HV021";
|
243
|
+
PostgresErrorCode["FDW_INVALID_ATTRIBUTE_VALUE"] = "HV024";
|
244
|
+
PostgresErrorCode["FDW_INVALID_COLUMN_NAME"] = "HV007";
|
245
|
+
PostgresErrorCode["FDW_INVALID_COLUMN_NUMBER"] = "HV008";
|
246
|
+
PostgresErrorCode["FDW_INVALID_DATA_TYPE"] = "HV004";
|
247
|
+
PostgresErrorCode["FDW_INVALID_DATA_TYPE_DESCRIPTORS"] = "HV006";
|
248
|
+
PostgresErrorCode["FDW_INVALID_DESCRIPTOR_FIELD_IDENTIFIER"] = "HV091";
|
249
|
+
PostgresErrorCode["FDW_INVALID_HANDLE"] = "HV00B";
|
250
|
+
PostgresErrorCode["FDW_INVALID_OPTION_INDEX"] = "HV00C";
|
251
|
+
PostgresErrorCode["FDW_INVALID_OPTION_NAME"] = "HV00D";
|
252
|
+
PostgresErrorCode["FDW_INVALID_STRING_LENGTH_OR_BUFFER_LENGTH"] = "HV090";
|
253
|
+
PostgresErrorCode["FDW_INVALID_STRING_FORMAT"] = "HV00A";
|
254
|
+
PostgresErrorCode["FDW_INVALID_USE_OF_NULL_POINTER"] = "HV009";
|
255
|
+
PostgresErrorCode["FDW_TOO_MANY_HANDLES"] = "HV014";
|
256
|
+
PostgresErrorCode["FDW_OUT_OF_MEMORY"] = "HV001";
|
257
|
+
PostgresErrorCode["FDW_NO_SCHEMAS"] = "HV00P";
|
258
|
+
PostgresErrorCode["FDW_OPTION_NAME_NOT_FOUND"] = "HV00J";
|
259
|
+
PostgresErrorCode["FDW_REPLY_HANDLE"] = "HV00K";
|
260
|
+
PostgresErrorCode["FDW_SCHEMA_NOT_FOUND"] = "HV00Q";
|
261
|
+
PostgresErrorCode["FDW_TABLE_NOT_FOUND"] = "HV00R";
|
262
|
+
PostgresErrorCode["FDW_UNABLE_TO_CREATE_EXECUTION"] = "HV00L";
|
263
|
+
PostgresErrorCode["FDW_UNABLE_TO_CREATE_REPLY"] = "HV00M";
|
264
|
+
PostgresErrorCode["FDW_UNABLE_TO_ESTABLISH_CONNECTION"] = "HV00N";
|
265
|
+
PostgresErrorCode["PLPGSQL_ERROR"] = "P0000";
|
266
|
+
PostgresErrorCode["RAISE_EXCEPTION"] = "P0001";
|
267
|
+
PostgresErrorCode["NO_DATA_FOUND"] = "P0002";
|
268
|
+
PostgresErrorCode["TOO_MANY_ROWS"] = "P0003";
|
269
|
+
PostgresErrorCode["ASSERT_FAILURE"] = "P0004";
|
270
|
+
PostgresErrorCode["INTERNAL_ERROR"] = "XX000";
|
271
|
+
PostgresErrorCode["DATA_CORRUPTED"] = "XX001";
|
272
|
+
PostgresErrorCode["INDEX_CORRUPTED"] = "XX002";
|
273
|
+
})(PostgresErrorCode = exports.PostgresErrorCode || (exports.PostgresErrorCode = {}));
|
274
|
+
//# sourceMappingURL=PostgresErrorCodes.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"PostgresErrorCodes.js","sourceRoot":"","sources":["../src/PostgresErrorCodes.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,IAAY,iBA2QX;AA3QD,WAAY,iBAAiB;IAC3B,oDAA+B,CAAA;IAC/B,sCAAiB,CAAA;IACjB,mEAA8C,CAAA;IAC9C,gEAA2C,CAAA;IAC3C,4EAAuD,CAAA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AA;IAC/B,gEAA2C,CAAA;IAC3C,sEAAiD,CAAA;IACjD,iDAA4B,CAAA;IAC5B,uDAAkC,CAAA;IAClC,sDAAiC,CAAA;IACjC,yEAAoD,CAAA;IACpD,wDAAmC,CAAA;IACnC,8DAAyC,CAAA;IACzC,mDAA8B,CAAA;IAC9B,gDAA2B,CAAA;IAC3B,6CAAwB,CAAA;IACxB,wDAAmC,CAAA;IACnC,+CAA0B,CAAA;IAC1B,mDAA8B,CAAA;IAC9B,kDAA6B,CAAA;IAC7B,6DAAwC,CAAA;IACxC,yDAAoC,CAAA;IACpC,iEAA4C,CAAA;IAC5C,4CAAuB,CAAA;IACvB,8CAAyB,CAAA;IACzB,4CAAuB,CAAA;IACvB,4CAAuB,CAAA;IACvB,6CAAwB,CAAA;IACxB,6CAAwB,CAAA;IACxB,6CAAwB,CAAA;IACxB,8CAAyB,CAAA;AAC3B,CAAC,EA3QW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QA2Q5B"}
|
package/lib/Repositories.d.ts
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Repositories.d.ts","sourceRoot":"","sources":["../src/Repositories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Repositories.js","sourceRoot":"","sources":["../src/Repositories.ts"],"names":[],"mappings":""}
|
@@ -1,12 +1,23 @@
|
|
1
1
|
import { DynamoDBDocument } from '@aws-sdk/lib-dynamodb';
|
2
2
|
import { Transaction, DynamoDbManager } from '..';
|
3
|
+
export type QueryFilterTypeBeginsWith = {
|
4
|
+
type: 'begins_with';
|
5
|
+
keyword: string;
|
6
|
+
};
|
7
|
+
export type QueryOptions = {
|
8
|
+
useSortKey?: boolean;
|
9
|
+
index?: keyof TableIndexes;
|
10
|
+
limit?: number;
|
11
|
+
order?: 'desc' | 'asc';
|
12
|
+
filter?: QueryFilterTypeBeginsWith;
|
13
|
+
};
|
3
14
|
interface Reader<T> {
|
4
|
-
queryItems(partialItem: Partial<T>,
|
15
|
+
queryItems(partialItem: Partial<T>, options?: QueryOptions): Promise<T[]>;
|
5
16
|
getItem(id: string | Partial<T>): Promise<T | undefined>;
|
6
17
|
}
|
7
18
|
interface Writer<T> {
|
8
19
|
createItem(item: Partial<T>): Promise<T>;
|
9
|
-
updateItem(partialItem: Partial<T
|
20
|
+
updateItem(partialItem: Partial<T>): Promise<T | undefined>;
|
10
21
|
deleteItem(partialItem: Partial<T>): Promise<number>;
|
11
22
|
}
|
12
23
|
type Repository<T> = Reader<T> & Writer<T>;
|
@@ -54,38 +65,61 @@ export declare abstract class AbstractDynamoDbRepository<SHAPE extends object, D
|
|
54
65
|
* @throws MissingKeyValuesError
|
55
66
|
*/
|
56
67
|
getItem(item: Partial<SHAPE>): Promise<DATA_CLASS | undefined>;
|
68
|
+
/**
|
69
|
+
* Get the single item each matching the key fields value in the given
|
70
|
+
* partial items. Will throw MissingKeyValuesError if key field values
|
71
|
+
* are missing
|
72
|
+
* Uses batchGet() to request 100 items in a batch
|
73
|
+
*
|
74
|
+
* @param item
|
75
|
+
*
|
76
|
+
* @throws MissingKeyValuesError
|
77
|
+
*/
|
78
|
+
getItems(items: Partial<SHAPE>[]): Promise<DATA_CLASS[]>;
|
79
|
+
/**
|
80
|
+
* Returns the batch items from the items primary key
|
81
|
+
*
|
82
|
+
* @param items
|
83
|
+
* @returns
|
84
|
+
*/
|
85
|
+
private getBatchItems;
|
57
86
|
/**
|
58
87
|
* Finds all the items matching the partition key or
|
59
88
|
* the gsi key (when gsi index name is specified)
|
60
89
|
*
|
61
90
|
* @param item
|
62
|
-
* @param
|
63
|
-
* @param index
|
91
|
+
* @param options
|
64
92
|
* @throws MissingKeyValuesError
|
65
93
|
*/
|
66
|
-
queryItems(item: Partial<SHAPE>,
|
94
|
+
queryItems(item: Partial<SHAPE>, options?: QueryOptions): Promise<DATA_CLASS[]>;
|
95
|
+
/**
|
96
|
+
* Evaluate filter condition for sort key
|
97
|
+
* @param filter
|
98
|
+
* @returns string
|
99
|
+
*/
|
100
|
+
private getFilterKeyConditionExpression;
|
67
101
|
/**
|
68
102
|
* Update the existing item matching the key fields value
|
69
|
-
* in the passed
|
70
|
-
* @param partialItem
|
103
|
+
* in the passed newValue
|
71
104
|
* @param newValue
|
72
105
|
* @param transaction
|
73
106
|
*
|
74
107
|
* @returns Promise<SHAPE | undefined>
|
75
108
|
* @throws MissingKeyValuesError
|
76
109
|
*/
|
77
|
-
updateItem(
|
110
|
+
updateItem(newValue: Partial<SHAPE>, transaction?: Transaction): Promise<DATA_CLASS | undefined>;
|
78
111
|
/**
|
79
112
|
* Adds new item to the table
|
80
113
|
*
|
81
114
|
* @param value
|
82
115
|
* @param transaction
|
116
|
+
* @param additionalValue Additional item properties that are not part of the DATA_CLASS
|
83
117
|
*
|
84
118
|
* @returns Promise<SHAPE>
|
85
119
|
* @throws DuplicateItemError
|
86
120
|
* @throws MissingKeyValuesError
|
87
121
|
*/
|
88
|
-
createItem(value: DATA_CLASS, transaction?: Transaction): Promise<DATA_CLASS>;
|
122
|
+
createItem(value: DATA_CLASS, transaction?: Transaction, additionalValue?: Partial<SHAPE>): Promise<DATA_CLASS>;
|
89
123
|
/**
|
90
124
|
* Deletes an item from the table
|
91
125
|
*
|
@@ -151,6 +185,12 @@ export declare abstract class AbstractDynamoDbRepository<SHAPE extends object, D
|
|
151
185
|
* @throw MissingKeyValuesError
|
152
186
|
*/
|
153
187
|
protected getKey(item: Partial<SHAPE>, attributeName: keyof KeysFormat): string;
|
188
|
+
/**
|
189
|
+
* Whether the given property name is part of the entity's pk/sk string
|
190
|
+
* @param propertyName
|
191
|
+
* @returns boolean
|
192
|
+
*/
|
193
|
+
private isPropertyPartOfKeys;
|
154
194
|
/**
|
155
195
|
* Validate the data matches with "DATA_MODEL"
|
156
196
|
* @param value
|
@@ -159,3 +199,4 @@ export declare abstract class AbstractDynamoDbRepository<SHAPE extends object, D
|
|
159
199
|
private assertValueMatchesModel;
|
160
200
|
}
|
161
201
|
export {};
|
202
|
+
//# sourceMappingURL=AbstractDynamoDbRepository.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AbstractDynamoDbRepository.d.ts","sourceRoot":"","sources":["../../src/dynamodb/AbstractDynamoDbRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAKjB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,WAAW,EAAE,eAAe,EAA+C,MAAM,IAAI,CAAC;AAG/F,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,EAAE,aAAa,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IAGzB,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,KAAK,CAAC,EAAE,MAAM,YAAY,CAAC;IAE3B,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAEvB,MAAM,CAAC,EAAE,yBAAyB,CAAC;CACpC,CAAC;AAEF,UAAU,MAAM,CAAC,CAAC;IAChB,UAAU,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;IAE1E,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;CAC1D;AAED,UAAU,MAAM,CAAC,CAAC;IAChB,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACzC,UAAU,CAAC,WAAW,EAAE,OAAO,CA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