@etohq/utils 1.3.0 → 1.4.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/LICENSE +21 -0
- package/dist/auth/token.d.ts +1 -1
- package/dist/auth/token.d.ts.map +1 -1
- package/dist/common/api-error.d.ts +205 -0
- package/dist/common/api-error.d.ts.map +1 -0
- package/dist/common/api-error.js +274 -0
- package/dist/common/api-error.js.map +1 -0
- package/dist/common/errors.d.ts +6 -7
- package/dist/common/errors.d.ts.map +1 -1
- package/dist/common/errors.js +25 -6
- package/dist/common/errors.js.map +1 -1
- package/dist/modules-sdk/create-pg-connection.d.ts +1 -1
- package/dist/modules-sdk/create-pg-connection.d.ts.map +1 -1
- package/dist/pg/index.d.ts +1 -1
- package/dist/pg/index.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +33 -30
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 Etohq
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/auth/token.d.ts
CHANGED
package/dist/auth/token.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../src/auth/token.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,GAC3B,cAAc,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,WAAW;IACT,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;CAC9B,
|
|
1
|
+
{"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../src/auth/token.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,GAC3B,cAAc,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,WAAW;IACT,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;CAC9B,QAYF,CAAA"}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
export declare class APIError extends Error {
|
|
2
|
+
/**
|
|
3
|
+
* The error code.
|
|
4
|
+
*/
|
|
5
|
+
readonly code: ErrCode;
|
|
6
|
+
readonly details?: ErrDetails;
|
|
7
|
+
static canceled(msg: string, cause?: Error): APIError;
|
|
8
|
+
static unknown(msg: string, cause?: Error): APIError;
|
|
9
|
+
static invalidArgument(msg: string, cause?: Error): APIError;
|
|
10
|
+
static deadlineExceeded(msg: string, cause?: Error): APIError;
|
|
11
|
+
static notFound(msg: string, cause?: Error): APIError;
|
|
12
|
+
static alreadyExists(msg: string, cause?: Error): APIError;
|
|
13
|
+
static permissionDenied(msg: string, cause?: Error): APIError;
|
|
14
|
+
static resourceExhausted(msg: string, cause?: Error): APIError;
|
|
15
|
+
static failedPrecondition(msg: string, cause?: Error): APIError;
|
|
16
|
+
static aborted(msg: string, cause?: Error): APIError;
|
|
17
|
+
static outOfRange(msg: string, cause?: Error): APIError;
|
|
18
|
+
static unimplemented(msg: string, cause?: Error): APIError;
|
|
19
|
+
static internal(msg: string, cause?: Error): APIError;
|
|
20
|
+
static unavailable(msg: string, cause?: Error): APIError;
|
|
21
|
+
static dataLoss(msg: string, cause?: Error): APIError;
|
|
22
|
+
static unauthenticated(msg: string, cause?: Error): APIError;
|
|
23
|
+
withDetails(details: ErrDetails): APIError;
|
|
24
|
+
constructor(code: ErrCode, msg: string, cause?: Error, details?: ErrDetails);
|
|
25
|
+
}
|
|
26
|
+
export type ErrDetails = Record<string, any>;
|
|
27
|
+
export declare enum ErrCode {
|
|
28
|
+
/**
|
|
29
|
+
* OK indicates the operation was successful.
|
|
30
|
+
*/
|
|
31
|
+
OK = "ok",
|
|
32
|
+
/**
|
|
33
|
+
* Canceled indicates the operation was canceled (typically by the caller).
|
|
34
|
+
*
|
|
35
|
+
* Encore will generate this error code when cancellation is requested.
|
|
36
|
+
*/
|
|
37
|
+
Canceled = "canceled",
|
|
38
|
+
/**
|
|
39
|
+
* Unknown error. An example of where this error may be returned is
|
|
40
|
+
* if a Status value received from another address space belongs to
|
|
41
|
+
* an error-space that is not known in this address space. Also
|
|
42
|
+
* errors raised by APIs that do not return enough error information
|
|
43
|
+
* may be converted to this error.
|
|
44
|
+
*
|
|
45
|
+
* Encore will generate this error code in the above two mentioned cases.
|
|
46
|
+
*/
|
|
47
|
+
Unknown = "unknown",
|
|
48
|
+
/**
|
|
49
|
+
* InvalidArgument indicates client specified an invalid argument.
|
|
50
|
+
* Note that this differs from FailedPrecondition. It indicates arguments
|
|
51
|
+
* that are problematic regardless of the state of the system
|
|
52
|
+
* (e.g., a malformed file name).
|
|
53
|
+
*
|
|
54
|
+
* This error code will not be generated by the gRPC framework.
|
|
55
|
+
*/
|
|
56
|
+
InvalidArgument = "invalid_argument",
|
|
57
|
+
/**
|
|
58
|
+
* DeadlineExceeded means operation expired before completion.
|
|
59
|
+
* For operations that change the state of the system, this error may be
|
|
60
|
+
* returned even if the operation has completed successfully. For
|
|
61
|
+
* example, a successful response from a server could have been delayed
|
|
62
|
+
* long enough for the deadline to expire.
|
|
63
|
+
*
|
|
64
|
+
* The gRPC framework will generate this error code when the deadline is
|
|
65
|
+
* exceeded.
|
|
66
|
+
*/
|
|
67
|
+
DeadlineExceeded = "deadline_exceeded",
|
|
68
|
+
/**
|
|
69
|
+
* NotFound means some requested entity (e.g., file or directory) was
|
|
70
|
+
* not found.
|
|
71
|
+
*
|
|
72
|
+
* This error code will not be generated by the gRPC framework.
|
|
73
|
+
*/
|
|
74
|
+
NotFound = "not_found",
|
|
75
|
+
/**
|
|
76
|
+
* AlreadyExists means an attempt to create an entity failed because one
|
|
77
|
+
* already exists.
|
|
78
|
+
*
|
|
79
|
+
* This error code will not be generated by the gRPC framework.
|
|
80
|
+
*/
|
|
81
|
+
AlreadyExists = "already_exists",
|
|
82
|
+
/**
|
|
83
|
+
* PermissionDenied indicates the caller does not have permission to
|
|
84
|
+
* execute the specified operation. It must not be used for rejections
|
|
85
|
+
* caused by exhausting some resource (use ResourceExhausted
|
|
86
|
+
* instead for those errors). It must not be
|
|
87
|
+
* used if the caller cannot be identified (use Unauthenticated
|
|
88
|
+
* instead for those errors).
|
|
89
|
+
*
|
|
90
|
+
* This error code will not be generated by the gRPC core framework,
|
|
91
|
+
* but expect authentication middleware to use it.
|
|
92
|
+
*/
|
|
93
|
+
PermissionDenied = "permission_denied",
|
|
94
|
+
/**
|
|
95
|
+
* ResourceExhausted indicates some resource has been exhausted, perhaps
|
|
96
|
+
* a per-user quota, or perhaps the entire file system is out of space.
|
|
97
|
+
*
|
|
98
|
+
* This error code will be generated by the gRPC framework in
|
|
99
|
+
* out-of-memory and server overload situations, or when a message is
|
|
100
|
+
* larger than the configured maximum size.
|
|
101
|
+
*/
|
|
102
|
+
ResourceExhausted = "resource_exhausted",
|
|
103
|
+
/**
|
|
104
|
+
* FailedPrecondition indicates operation was rejected because the
|
|
105
|
+
* system is not in a state required for the operation's execution.
|
|
106
|
+
* For example, directory to be deleted may be non-empty, an rmdir
|
|
107
|
+
* operation is applied to a non-directory, etc.
|
|
108
|
+
*
|
|
109
|
+
* A litmus test that may help a service implementor in deciding
|
|
110
|
+
* between FailedPrecondition, Aborted, and Unavailable:
|
|
111
|
+
* (a) Use Unavailable if the client can retry just the failing call.
|
|
112
|
+
* (b) Use Aborted if the client should retry at a higher-level
|
|
113
|
+
* (e.g., restarting a read-modify-write sequence).
|
|
114
|
+
* (c) Use FailedPrecondition if the client should not retry until
|
|
115
|
+
* the system state has been explicitly fixed. E.g., if an "rmdir"
|
|
116
|
+
* fails because the directory is non-empty, FailedPrecondition
|
|
117
|
+
* should be returned since the client should not retry unless
|
|
118
|
+
* they have first fixed up the directory by deleting files from it.
|
|
119
|
+
* (d) Use FailedPrecondition if the client performs conditional
|
|
120
|
+
* REST Get/Update/Delete on a resource and the resource on the
|
|
121
|
+
* server does not match the condition. E.g., conflicting
|
|
122
|
+
* read-modify-write on the same resource.
|
|
123
|
+
*
|
|
124
|
+
* This error code will not be generated by the gRPC framework.
|
|
125
|
+
*/
|
|
126
|
+
FailedPrecondition = "failed_precondition",
|
|
127
|
+
/**
|
|
128
|
+
* Aborted indicates the operation was aborted, typically due to a
|
|
129
|
+
* concurrency issue like sequencer check failures, transaction aborts,
|
|
130
|
+
* etc.
|
|
131
|
+
*
|
|
132
|
+
* See litmus test above for deciding between FailedPrecondition,
|
|
133
|
+
* Aborted, and Unavailable.
|
|
134
|
+
*/
|
|
135
|
+
Aborted = "aborted",
|
|
136
|
+
/**
|
|
137
|
+
* OutOfRange means operation was attempted past the valid range.
|
|
138
|
+
* E.g., seeking or reading past end of file.
|
|
139
|
+
*
|
|
140
|
+
* Unlike InvalidArgument, this error indicates a problem that may
|
|
141
|
+
* be fixed if the system state changes. For example, a 32-bit file
|
|
142
|
+
* system will generate InvalidArgument if asked to read at an
|
|
143
|
+
* offset that is not in the range [0,2^32-1], but it will generate
|
|
144
|
+
* OutOfRange if asked to read from an offset past the current
|
|
145
|
+
* file size.
|
|
146
|
+
*
|
|
147
|
+
* There is a fair bit of overlap between FailedPrecondition and
|
|
148
|
+
* OutOfRange. We recommend using OutOfRange (the more specific
|
|
149
|
+
* error) when it applies so that callers who are iterating through
|
|
150
|
+
* a space can easily look for an OutOfRange error to detect when
|
|
151
|
+
* they are done.
|
|
152
|
+
*
|
|
153
|
+
* This error code will not be generated by the gRPC framework.
|
|
154
|
+
*/
|
|
155
|
+
OutOfRange = "out_of_range",
|
|
156
|
+
/**
|
|
157
|
+
* Unimplemented indicates operation is not implemented or not
|
|
158
|
+
* supported/enabled in this service.
|
|
159
|
+
*
|
|
160
|
+
* This error code will be generated by the gRPC framework. Most
|
|
161
|
+
* commonly, you will see this error code when a method implementation
|
|
162
|
+
* is missing on the server. It can also be generated for unknown
|
|
163
|
+
* compression algorithms or a disagreement as to whether an RPC should
|
|
164
|
+
* be streaming.
|
|
165
|
+
*/
|
|
166
|
+
Unimplemented = "unimplemented",
|
|
167
|
+
/**
|
|
168
|
+
* Internal errors. Means some invariants expected by underlying
|
|
169
|
+
* system has been broken. If you see one of these errors,
|
|
170
|
+
* something is very broken.
|
|
171
|
+
*
|
|
172
|
+
* This error code will be generated by the gRPC framework in several
|
|
173
|
+
* internal error conditions.
|
|
174
|
+
*/
|
|
175
|
+
Internal = "internal",
|
|
176
|
+
/**
|
|
177
|
+
* Unavailable indicates the service is currently unavailable.
|
|
178
|
+
* This is a most likely a transient condition and may be corrected
|
|
179
|
+
* by retrying with a backoff. Note that it is not always safe to retry
|
|
180
|
+
* non-idempotent operations.
|
|
181
|
+
*
|
|
182
|
+
* See litmus test above for deciding between FailedPrecondition,
|
|
183
|
+
* Aborted, and Unavailable.
|
|
184
|
+
*
|
|
185
|
+
* This error code will be generated by the gRPC framework during
|
|
186
|
+
* abrupt shutdown of a server process or network connection.
|
|
187
|
+
*/
|
|
188
|
+
Unavailable = "unavailable",
|
|
189
|
+
/**
|
|
190
|
+
* DataLoss indicates unrecoverable data loss or corruption.
|
|
191
|
+
*
|
|
192
|
+
* This error code will not be generated by the gRPC framework.
|
|
193
|
+
*/
|
|
194
|
+
DataLoss = "data_loss",
|
|
195
|
+
/**
|
|
196
|
+
* Unauthenticated indicates the request does not have valid
|
|
197
|
+
* authentication credentials for the operation.
|
|
198
|
+
*
|
|
199
|
+
* The gRPC framework will generate this error code when the
|
|
200
|
+
* authentication metadata is invalid or a Credentials callback fails,
|
|
201
|
+
* but also expect authentication middleware to generate it.
|
|
202
|
+
*/
|
|
203
|
+
Unauthenticated = "unauthenticated"
|
|
204
|
+
}
|
|
205
|
+
//# sourceMappingURL=api-error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-error.d.ts","sourceRoot":"","sources":["../../src/common/api-error.ts"],"names":[],"mappings":"AAGA,qBAAa,QAAS,SAAQ,KAAK;IACjC;;OAEG;IACH,SAAgB,IAAI,EAAE,OAAO,CAAA;IAC7B,SAAgB,OAAO,CAAC,EAAE,UAAU,CAAA;IAGpC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;IAK1C,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;IAKzC,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;IAKjD,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;IAKlD,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;IAK1C,MAAM,CAAC,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;IAK/C,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;IAKlD,MAAM,CAAC,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;IAKnD,MAAM,CAAC,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;IAKpD,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;IAKzC,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;IAK5C,MAAM,CAAC,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;IAK/C,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;IAK1C,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;IAK7C,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;IAK1C,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;IAKjD,WAAW,CAAC,OAAO,EAAE,UAAU,GAAG,QAAQ;gBAM9B,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,UAAU;CAmB5E;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AAE5C,oBAAY,OAAO;IACjB;;OAEG;IACH,EAAE,OAAO;IAET;;;;OAIG;IACH,QAAQ,aAAa;IAErB;;;;;;;;OAQG;IACH,OAAO,YAAY;IAEnB;;;;;;;OAOG;IACH,eAAe,qBAAqB;IAEpC;;;;;;;;;OASG;IACH,gBAAgB,sBAAsB;IAEtC;;;;;OAKG;IACH,QAAQ,cAAc;IAEtB;;;;;OAKG;IACH,aAAa,mBAAmB;IAEhC;;;;;;;;;;OAUG;IACH,gBAAgB,sBAAsB;IAEtC;;;;;;;OAOG;IACH,iBAAiB,uBAAuB;IAExC;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,kBAAkB,wBAAwB;IAE1C;;;;;;;OAOG;IACH,OAAO,YAAY;IAEnB;;;;;;;;;;;;;;;;;;OAkBG;IACH,UAAU,iBAAiB;IAE3B;;;;;;;;;OASG;IACH,aAAa,kBAAkB;IAE/B;;;;;;;OAOG;IACH,QAAQ,aAAa;IAErB;;;;;;;;;;;OAWG;IACH,WAAW,gBAAgB;IAE3B;;;;OAIG;IACH,QAAQ,cAAc;IAEtB;;;;;;;OAOG;IACH,eAAe,oBAAoB;CACpC"}
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// https://github.com/encoredev/encore/blob/main/runtimes/js/encore.dev/api/error.ts
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ErrCode = exports.APIError = void 0;
|
|
5
|
+
class APIError extends Error {
|
|
6
|
+
// Constructs an APIError with the Canceled error code.
|
|
7
|
+
static canceled(msg, cause) {
|
|
8
|
+
return new APIError(ErrCode.Canceled, msg, cause);
|
|
9
|
+
}
|
|
10
|
+
// Constructs an APIError with the Unknown error code.
|
|
11
|
+
static unknown(msg, cause) {
|
|
12
|
+
return new APIError(ErrCode.Unknown, msg, cause);
|
|
13
|
+
}
|
|
14
|
+
// Constructs an APIError with the InvalidArgument error code.
|
|
15
|
+
static invalidArgument(msg, cause) {
|
|
16
|
+
return new APIError(ErrCode.InvalidArgument, msg, cause);
|
|
17
|
+
}
|
|
18
|
+
// Constructs an APIError with the DeadlineExceeded error code.
|
|
19
|
+
static deadlineExceeded(msg, cause) {
|
|
20
|
+
return new APIError(ErrCode.DeadlineExceeded, msg, cause);
|
|
21
|
+
}
|
|
22
|
+
// Constructs an APIError with the NotFound error code.
|
|
23
|
+
static notFound(msg, cause) {
|
|
24
|
+
return new APIError(ErrCode.NotFound, msg, cause);
|
|
25
|
+
}
|
|
26
|
+
// Constructs an APIError with the AlreadyExists error code.
|
|
27
|
+
static alreadyExists(msg, cause) {
|
|
28
|
+
return new APIError(ErrCode.AlreadyExists, msg, cause);
|
|
29
|
+
}
|
|
30
|
+
// Constructs an APIError with the PermissionDenied error code.
|
|
31
|
+
static permissionDenied(msg, cause) {
|
|
32
|
+
return new APIError(ErrCode.PermissionDenied, msg, cause);
|
|
33
|
+
}
|
|
34
|
+
// Constructs an APIError with the ResourceExhausted error code.
|
|
35
|
+
static resourceExhausted(msg, cause) {
|
|
36
|
+
return new APIError(ErrCode.ResourceExhausted, msg, cause);
|
|
37
|
+
}
|
|
38
|
+
// Constructs an APIError with the FailedPrecondition error code.
|
|
39
|
+
static failedPrecondition(msg, cause) {
|
|
40
|
+
return new APIError(ErrCode.FailedPrecondition, msg, cause);
|
|
41
|
+
}
|
|
42
|
+
// Constructs an APIError with the Aborted error code.
|
|
43
|
+
static aborted(msg, cause) {
|
|
44
|
+
return new APIError(ErrCode.Aborted, msg, cause);
|
|
45
|
+
}
|
|
46
|
+
// Constructs an APIError with the OutOfRange error code.
|
|
47
|
+
static outOfRange(msg, cause) {
|
|
48
|
+
return new APIError(ErrCode.OutOfRange, msg, cause);
|
|
49
|
+
}
|
|
50
|
+
// Constructs an APIError with the Unimplemented error code.
|
|
51
|
+
static unimplemented(msg, cause) {
|
|
52
|
+
return new APIError(ErrCode.Unimplemented, msg, cause);
|
|
53
|
+
}
|
|
54
|
+
// Constructs an APIError with the Internal error code.
|
|
55
|
+
static internal(msg, cause) {
|
|
56
|
+
return new APIError(ErrCode.Internal, msg, cause);
|
|
57
|
+
}
|
|
58
|
+
// Constructs an APIError with the Unavailable error code.
|
|
59
|
+
static unavailable(msg, cause) {
|
|
60
|
+
return new APIError(ErrCode.Unavailable, msg, cause);
|
|
61
|
+
}
|
|
62
|
+
// Constructs an APIError with the DataLoss error code.
|
|
63
|
+
static dataLoss(msg, cause) {
|
|
64
|
+
return new APIError(ErrCode.DataLoss, msg, cause);
|
|
65
|
+
}
|
|
66
|
+
// Constructs an APIError with the Unauthenticated error code.
|
|
67
|
+
static unauthenticated(msg, cause) {
|
|
68
|
+
return new APIError(ErrCode.Unauthenticated, msg, cause);
|
|
69
|
+
}
|
|
70
|
+
// Constructs a new APIError from the previous one with the provided details
|
|
71
|
+
withDetails(details) {
|
|
72
|
+
// @ts-ignore
|
|
73
|
+
return new APIError(this.code, this.message, this.cause, details);
|
|
74
|
+
}
|
|
75
|
+
// Constructs an APIError with the given error code, message, and (optionally) cause.
|
|
76
|
+
constructor(code, msg, cause, details) {
|
|
77
|
+
// extending errors causes issues after you construct them, unless you apply the following fixes
|
|
78
|
+
// @ts-ignore
|
|
79
|
+
super(msg, { cause });
|
|
80
|
+
this.code = code;
|
|
81
|
+
this.details = details;
|
|
82
|
+
// set error name as constructor name, make it not enumerable to keep native Error behavior
|
|
83
|
+
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/new.target#new.target_in_constructors
|
|
84
|
+
Object.defineProperty(this, "name", {
|
|
85
|
+
value: "APIError",
|
|
86
|
+
enumerable: false,
|
|
87
|
+
configurable: true,
|
|
88
|
+
});
|
|
89
|
+
// Fix the prototype chain, capture stack trace.
|
|
90
|
+
Object.setPrototypeOf(this, APIError.prototype);
|
|
91
|
+
Error.captureStackTrace(this, this.constructor);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
exports.APIError = APIError;
|
|
95
|
+
var ErrCode;
|
|
96
|
+
(function (ErrCode) {
|
|
97
|
+
/**
|
|
98
|
+
* OK indicates the operation was successful.
|
|
99
|
+
*/
|
|
100
|
+
ErrCode["OK"] = "ok";
|
|
101
|
+
/**
|
|
102
|
+
* Canceled indicates the operation was canceled (typically by the caller).
|
|
103
|
+
*
|
|
104
|
+
* Encore will generate this error code when cancellation is requested.
|
|
105
|
+
*/
|
|
106
|
+
ErrCode["Canceled"] = "canceled";
|
|
107
|
+
/**
|
|
108
|
+
* Unknown error. An example of where this error may be returned is
|
|
109
|
+
* if a Status value received from another address space belongs to
|
|
110
|
+
* an error-space that is not known in this address space. Also
|
|
111
|
+
* errors raised by APIs that do not return enough error information
|
|
112
|
+
* may be converted to this error.
|
|
113
|
+
*
|
|
114
|
+
* Encore will generate this error code in the above two mentioned cases.
|
|
115
|
+
*/
|
|
116
|
+
ErrCode["Unknown"] = "unknown";
|
|
117
|
+
/**
|
|
118
|
+
* InvalidArgument indicates client specified an invalid argument.
|
|
119
|
+
* Note that this differs from FailedPrecondition. It indicates arguments
|
|
120
|
+
* that are problematic regardless of the state of the system
|
|
121
|
+
* (e.g., a malformed file name).
|
|
122
|
+
*
|
|
123
|
+
* This error code will not be generated by the gRPC framework.
|
|
124
|
+
*/
|
|
125
|
+
ErrCode["InvalidArgument"] = "invalid_argument";
|
|
126
|
+
/**
|
|
127
|
+
* DeadlineExceeded means operation expired before completion.
|
|
128
|
+
* For operations that change the state of the system, this error may be
|
|
129
|
+
* returned even if the operation has completed successfully. For
|
|
130
|
+
* example, a successful response from a server could have been delayed
|
|
131
|
+
* long enough for the deadline to expire.
|
|
132
|
+
*
|
|
133
|
+
* The gRPC framework will generate this error code when the deadline is
|
|
134
|
+
* exceeded.
|
|
135
|
+
*/
|
|
136
|
+
ErrCode["DeadlineExceeded"] = "deadline_exceeded";
|
|
137
|
+
/**
|
|
138
|
+
* NotFound means some requested entity (e.g., file or directory) was
|
|
139
|
+
* not found.
|
|
140
|
+
*
|
|
141
|
+
* This error code will not be generated by the gRPC framework.
|
|
142
|
+
*/
|
|
143
|
+
ErrCode["NotFound"] = "not_found";
|
|
144
|
+
/**
|
|
145
|
+
* AlreadyExists means an attempt to create an entity failed because one
|
|
146
|
+
* already exists.
|
|
147
|
+
*
|
|
148
|
+
* This error code will not be generated by the gRPC framework.
|
|
149
|
+
*/
|
|
150
|
+
ErrCode["AlreadyExists"] = "already_exists";
|
|
151
|
+
/**
|
|
152
|
+
* PermissionDenied indicates the caller does not have permission to
|
|
153
|
+
* execute the specified operation. It must not be used for rejections
|
|
154
|
+
* caused by exhausting some resource (use ResourceExhausted
|
|
155
|
+
* instead for those errors). It must not be
|
|
156
|
+
* used if the caller cannot be identified (use Unauthenticated
|
|
157
|
+
* instead for those errors).
|
|
158
|
+
*
|
|
159
|
+
* This error code will not be generated by the gRPC core framework,
|
|
160
|
+
* but expect authentication middleware to use it.
|
|
161
|
+
*/
|
|
162
|
+
ErrCode["PermissionDenied"] = "permission_denied";
|
|
163
|
+
/**
|
|
164
|
+
* ResourceExhausted indicates some resource has been exhausted, perhaps
|
|
165
|
+
* a per-user quota, or perhaps the entire file system is out of space.
|
|
166
|
+
*
|
|
167
|
+
* This error code will be generated by the gRPC framework in
|
|
168
|
+
* out-of-memory and server overload situations, or when a message is
|
|
169
|
+
* larger than the configured maximum size.
|
|
170
|
+
*/
|
|
171
|
+
ErrCode["ResourceExhausted"] = "resource_exhausted";
|
|
172
|
+
/**
|
|
173
|
+
* FailedPrecondition indicates operation was rejected because the
|
|
174
|
+
* system is not in a state required for the operation's execution.
|
|
175
|
+
* For example, directory to be deleted may be non-empty, an rmdir
|
|
176
|
+
* operation is applied to a non-directory, etc.
|
|
177
|
+
*
|
|
178
|
+
* A litmus test that may help a service implementor in deciding
|
|
179
|
+
* between FailedPrecondition, Aborted, and Unavailable:
|
|
180
|
+
* (a) Use Unavailable if the client can retry just the failing call.
|
|
181
|
+
* (b) Use Aborted if the client should retry at a higher-level
|
|
182
|
+
* (e.g., restarting a read-modify-write sequence).
|
|
183
|
+
* (c) Use FailedPrecondition if the client should not retry until
|
|
184
|
+
* the system state has been explicitly fixed. E.g., if an "rmdir"
|
|
185
|
+
* fails because the directory is non-empty, FailedPrecondition
|
|
186
|
+
* should be returned since the client should not retry unless
|
|
187
|
+
* they have first fixed up the directory by deleting files from it.
|
|
188
|
+
* (d) Use FailedPrecondition if the client performs conditional
|
|
189
|
+
* REST Get/Update/Delete on a resource and the resource on the
|
|
190
|
+
* server does not match the condition. E.g., conflicting
|
|
191
|
+
* read-modify-write on the same resource.
|
|
192
|
+
*
|
|
193
|
+
* This error code will not be generated by the gRPC framework.
|
|
194
|
+
*/
|
|
195
|
+
ErrCode["FailedPrecondition"] = "failed_precondition";
|
|
196
|
+
/**
|
|
197
|
+
* Aborted indicates the operation was aborted, typically due to a
|
|
198
|
+
* concurrency issue like sequencer check failures, transaction aborts,
|
|
199
|
+
* etc.
|
|
200
|
+
*
|
|
201
|
+
* See litmus test above for deciding between FailedPrecondition,
|
|
202
|
+
* Aborted, and Unavailable.
|
|
203
|
+
*/
|
|
204
|
+
ErrCode["Aborted"] = "aborted";
|
|
205
|
+
/**
|
|
206
|
+
* OutOfRange means operation was attempted past the valid range.
|
|
207
|
+
* E.g., seeking or reading past end of file.
|
|
208
|
+
*
|
|
209
|
+
* Unlike InvalidArgument, this error indicates a problem that may
|
|
210
|
+
* be fixed if the system state changes. For example, a 32-bit file
|
|
211
|
+
* system will generate InvalidArgument if asked to read at an
|
|
212
|
+
* offset that is not in the range [0,2^32-1], but it will generate
|
|
213
|
+
* OutOfRange if asked to read from an offset past the current
|
|
214
|
+
* file size.
|
|
215
|
+
*
|
|
216
|
+
* There is a fair bit of overlap between FailedPrecondition and
|
|
217
|
+
* OutOfRange. We recommend using OutOfRange (the more specific
|
|
218
|
+
* error) when it applies so that callers who are iterating through
|
|
219
|
+
* a space can easily look for an OutOfRange error to detect when
|
|
220
|
+
* they are done.
|
|
221
|
+
*
|
|
222
|
+
* This error code will not be generated by the gRPC framework.
|
|
223
|
+
*/
|
|
224
|
+
ErrCode["OutOfRange"] = "out_of_range";
|
|
225
|
+
/**
|
|
226
|
+
* Unimplemented indicates operation is not implemented or not
|
|
227
|
+
* supported/enabled in this service.
|
|
228
|
+
*
|
|
229
|
+
* This error code will be generated by the gRPC framework. Most
|
|
230
|
+
* commonly, you will see this error code when a method implementation
|
|
231
|
+
* is missing on the server. It can also be generated for unknown
|
|
232
|
+
* compression algorithms or a disagreement as to whether an RPC should
|
|
233
|
+
* be streaming.
|
|
234
|
+
*/
|
|
235
|
+
ErrCode["Unimplemented"] = "unimplemented";
|
|
236
|
+
/**
|
|
237
|
+
* Internal errors. Means some invariants expected by underlying
|
|
238
|
+
* system has been broken. If you see one of these errors,
|
|
239
|
+
* something is very broken.
|
|
240
|
+
*
|
|
241
|
+
* This error code will be generated by the gRPC framework in several
|
|
242
|
+
* internal error conditions.
|
|
243
|
+
*/
|
|
244
|
+
ErrCode["Internal"] = "internal";
|
|
245
|
+
/**
|
|
246
|
+
* Unavailable indicates the service is currently unavailable.
|
|
247
|
+
* This is a most likely a transient condition and may be corrected
|
|
248
|
+
* by retrying with a backoff. Note that it is not always safe to retry
|
|
249
|
+
* non-idempotent operations.
|
|
250
|
+
*
|
|
251
|
+
* See litmus test above for deciding between FailedPrecondition,
|
|
252
|
+
* Aborted, and Unavailable.
|
|
253
|
+
*
|
|
254
|
+
* This error code will be generated by the gRPC framework during
|
|
255
|
+
* abrupt shutdown of a server process or network connection.
|
|
256
|
+
*/
|
|
257
|
+
ErrCode["Unavailable"] = "unavailable";
|
|
258
|
+
/**
|
|
259
|
+
* DataLoss indicates unrecoverable data loss or corruption.
|
|
260
|
+
*
|
|
261
|
+
* This error code will not be generated by the gRPC framework.
|
|
262
|
+
*/
|
|
263
|
+
ErrCode["DataLoss"] = "data_loss";
|
|
264
|
+
/**
|
|
265
|
+
* Unauthenticated indicates the request does not have valid
|
|
266
|
+
* authentication credentials for the operation.
|
|
267
|
+
*
|
|
268
|
+
* The gRPC framework will generate this error code when the
|
|
269
|
+
* authentication metadata is invalid or a Credentials callback fails,
|
|
270
|
+
* but also expect authentication middleware to generate it.
|
|
271
|
+
*/
|
|
272
|
+
ErrCode["Unauthenticated"] = "unauthenticated";
|
|
273
|
+
})(ErrCode || (exports.ErrCode = ErrCode = {}));
|
|
274
|
+
//# sourceMappingURL=api-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-error.js","sourceRoot":"","sources":["../../src/common/api-error.ts"],"names":[],"mappings":"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"}
|
package/dist/common/errors.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { ErrCode, APIError } from "./api-error";
|
|
1
2
|
/**
|
|
2
3
|
* @typedef EtoErrorType
|
|
3
4
|
*
|
|
4
5
|
*/
|
|
5
6
|
export declare const EtoErrorTypes: {
|
|
6
|
-
/** Errors stemming from the database */
|
|
7
7
|
DB_ERROR: string;
|
|
8
8
|
DUPLICATE_ERROR: string;
|
|
9
9
|
INVALID_ARGUMENT: string;
|
|
@@ -26,14 +26,12 @@ export declare const EtoErrorCodes: {
|
|
|
26
26
|
* Standardized error to be used across Eto project.
|
|
27
27
|
* @extends Error
|
|
28
28
|
*/
|
|
29
|
-
export declare class EtoError extends
|
|
29
|
+
export declare class EtoError extends APIError {
|
|
30
30
|
__isEtoError: boolean;
|
|
31
31
|
type: string;
|
|
32
|
-
|
|
33
|
-
code?: string;
|
|
32
|
+
code: ErrCode;
|
|
34
33
|
date: Date;
|
|
35
34
|
static Types: {
|
|
36
|
-
/** Errors stemming from the database */
|
|
37
35
|
DB_ERROR: string;
|
|
38
36
|
DUPLICATE_ERROR: string;
|
|
39
37
|
INVALID_ARGUMENT: string;
|
|
@@ -59,10 +57,11 @@ export declare class EtoError extends Error {
|
|
|
59
57
|
* @param {string} code - code of error
|
|
60
58
|
* @param {Array} params - params
|
|
61
59
|
*/
|
|
62
|
-
constructor(type: string, message: string, code?: string, ...params: any);
|
|
60
|
+
constructor(type: string, message: string, code?: string, ...params: any[]);
|
|
63
61
|
/**
|
|
62
|
+
static isEtoError(err: unknown): err is EtoError {
|
|
64
63
|
* Checks the object for the EtoError type.
|
|
65
64
|
*/
|
|
66
|
-
static isEtoError(
|
|
65
|
+
static isEtoError(err: unknown): err is EtoError;
|
|
67
66
|
}
|
|
68
67
|
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/common/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/common/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE/C;;;GAGG;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;CAazB,CAAA;AAED,eAAO,MAAM,aAAa;;;;CAIzB,CAAA;AAkBD;;;GAGG;AACH,qBAAa,QAAS,SAAQ,QAAQ;IACpC,YAAY,UAAO;IAEZ,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,OAAO,CAAA;IACb,IAAI,EAAE,IAAI,CAAA;IAEjB,OAAc,KAAK;;;;;;;;;;;;;MAAgB;IACnC,OAAc,KAAK;;;;MAAgB;IAEnC;;;;;;OAMG;gBACS,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE;IAiB1E;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,QAAQ;CAGjD"}
|
package/dist/common/errors.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EtoError = exports.EtoErrorCodes = exports.EtoErrorTypes = void 0;
|
|
4
|
+
const api_error_1 = require("./api-error");
|
|
4
5
|
/**
|
|
5
6
|
* @typedef EtoErrorType
|
|
6
7
|
*
|
|
7
8
|
*/
|
|
8
9
|
exports.EtoErrorTypes = {
|
|
9
|
-
/** Errors stemming from the database */
|
|
10
10
|
DB_ERROR: "database_error",
|
|
11
11
|
DUPLICATE_ERROR: "duplicate_error",
|
|
12
12
|
INVALID_ARGUMENT: "invalid_argument",
|
|
@@ -25,11 +25,26 @@ exports.EtoErrorCodes = {
|
|
|
25
25
|
CART_INCOMPATIBLE_STATE: "cart_incompatible_state",
|
|
26
26
|
UNKNOWN_MODULES: "unknown_modules",
|
|
27
27
|
};
|
|
28
|
+
const EtoTypeToErrCode = {
|
|
29
|
+
[exports.EtoErrorTypes.INVALID_ARGUMENT]: api_error_1.ErrCode.InvalidArgument,
|
|
30
|
+
[exports.EtoErrorTypes.NOT_FOUND]: api_error_1.ErrCode.NotFound,
|
|
31
|
+
[exports.EtoErrorTypes.UNAUTHORIZED]: api_error_1.ErrCode.PermissionDenied,
|
|
32
|
+
[exports.EtoErrorTypes.DUPLICATE_ERROR]: api_error_1.ErrCode.AlreadyExists,
|
|
33
|
+
[exports.EtoErrorTypes.UNEXPECTED_STATE]: api_error_1.ErrCode.FailedPrecondition,
|
|
34
|
+
[exports.EtoErrorTypes.CONFLICT]: api_error_1.ErrCode.Aborted,
|
|
35
|
+
[exports.EtoErrorTypes.DB_ERROR]: api_error_1.ErrCode.Internal,
|
|
36
|
+
[exports.EtoErrorTypes.INVALID_DATA]: api_error_1.ErrCode.OutOfRange,
|
|
37
|
+
[exports.EtoErrorTypes.UNKNOWN_MODULES]: api_error_1.ErrCode.Unknown,
|
|
38
|
+
// Defaults
|
|
39
|
+
[exports.EtoErrorTypes.NOT_ALLOWED]: api_error_1.ErrCode.PermissionDenied,
|
|
40
|
+
[exports.EtoErrorTypes.PAYMENT_AUTHORIZATION_ERROR]: api_error_1.ErrCode.FailedPrecondition,
|
|
41
|
+
[exports.EtoErrorTypes.PAYMENT_REQUIRES_MORE_ERROR]: api_error_1.ErrCode.ResourceExhausted,
|
|
42
|
+
};
|
|
28
43
|
/**
|
|
29
44
|
* Standardized error to be used across Eto project.
|
|
30
45
|
* @extends Error
|
|
31
46
|
*/
|
|
32
|
-
class EtoError extends
|
|
47
|
+
class EtoError extends api_error_1.APIError {
|
|
33
48
|
/**
|
|
34
49
|
* Creates a standardized error to be used across Eto project.
|
|
35
50
|
* @param {string} type - type of error
|
|
@@ -38,21 +53,25 @@ class EtoError extends Error {
|
|
|
38
53
|
* @param {Array} params - params
|
|
39
54
|
*/
|
|
40
55
|
constructor(type, message, code, ...params) {
|
|
41
|
-
|
|
56
|
+
const errCode = EtoTypeToErrCode[type] ?? api_error_1.ErrCode.Unknown;
|
|
57
|
+
const details = code ? { code } : undefined;
|
|
58
|
+
// APIError constructor: (code: ErrCode, msg: string, cause?: Error, details?: ErrDetails)
|
|
59
|
+
super(errCode, message, undefined, details);
|
|
42
60
|
this.__isEtoError = true;
|
|
43
61
|
if (Error.captureStackTrace) {
|
|
44
62
|
Error.captureStackTrace(this, EtoError);
|
|
45
63
|
}
|
|
46
64
|
this.type = type;
|
|
47
|
-
this.code =
|
|
65
|
+
this.code = errCode || api_error_1.ErrCode.Internal;
|
|
48
66
|
this.message = message;
|
|
49
67
|
this.date = new Date();
|
|
50
68
|
}
|
|
51
69
|
/**
|
|
70
|
+
static isEtoError(err: unknown): err is EtoError {
|
|
52
71
|
* Checks the object for the EtoError type.
|
|
53
72
|
*/
|
|
54
|
-
static isEtoError(
|
|
55
|
-
return !!
|
|
73
|
+
static isEtoError(err) {
|
|
74
|
+
return !!(err && typeof err === "object" && err.__isEtoError);
|
|
56
75
|
}
|
|
57
76
|
}
|
|
58
77
|
exports.EtoError = EtoError;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/common/errors.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/common/errors.ts"],"names":[],"mappings":";;;AAAA,2CAA+C;AAE/C;;;GAGG;AAEU,QAAA,aAAa,GAAG;IAC3B,QAAQ,EAAE,gBAAgB;IAC1B,eAAe,EAAE,iBAAiB;IAClC,gBAAgB,EAAE,kBAAkB;IACpC,YAAY,EAAE,cAAc;IAC5B,YAAY,EAAE,cAAc;IAC5B,SAAS,EAAE,WAAW;IACtB,WAAW,EAAE,aAAa;IAC1B,gBAAgB,EAAE,kBAAkB;IACpC,QAAQ,EAAE,UAAU;IACpB,eAAe,EAAE,iBAAiB;IAClC,2BAA2B,EAAE,6BAA6B;IAC1D,2BAA2B,EAAE,6BAA6B;CAC3D,CAAA;AAEY,QAAA,aAAa,GAAG;IAC3B,sBAAsB,EAAE,wBAAwB;IAChD,uBAAuB,EAAE,yBAAyB;IAClD,eAAe,EAAE,iBAAiB;CACnC,CAAA;AAED,MAAM,gBAAgB,GAA4B;IAChD,CAAC,qBAAa,CAAC,gBAAgB,CAAC,EAAE,mBAAO,CAAC,eAAe;IACzD,CAAC,qBAAa,CAAC,SAAS,CAAC,EAAE,mBAAO,CAAC,QAAQ;IAC3C,CAAC,qBAAa,CAAC,YAAY,CAAC,EAAE,mBAAO,CAAC,gBAAgB;IACtD,CAAC,qBAAa,CAAC,eAAe,CAAC,EAAE,mBAAO,CAAC,aAAa;IACtD,CAAC,qBAAa,CAAC,gBAAgB,CAAC,EAAE,mBAAO,CAAC,kBAAkB;IAC5D,CAAC,qBAAa,CAAC,QAAQ,CAAC,EAAE,mBAAO,CAAC,OAAO;IACzC,CAAC,qBAAa,CAAC,QAAQ,CAAC,EAAE,mBAAO,CAAC,QAAQ;IAC1C,CAAC,qBAAa,CAAC,YAAY,CAAC,EAAE,mBAAO,CAAC,UAAU;IAChD,CAAC,qBAAa,CAAC,eAAe,CAAC,EAAE,mBAAO,CAAC,OAAO;IAChD,WAAW;IACX,CAAC,qBAAa,CAAC,WAAW,CAAC,EAAE,mBAAO,CAAC,gBAAgB;IACrD,CAAC,qBAAa,CAAC,2BAA2B,CAAC,EAAE,mBAAO,CAAC,kBAAkB;IACvE,CAAC,qBAAa,CAAC,2BAA2B,CAAC,EAAE,mBAAO,CAAC,iBAAiB;CACvE,CAAA;AAED;;;GAGG;AACH,MAAa,QAAS,SAAQ,oBAAQ;IAUpC;;;;;;OAMG;IACH,YAAY,IAAY,EAAE,OAAe,EAAE,IAAa,EAAE,GAAG,MAAa;QACxE,MAAM,OAAO,GAAG,gBAAgB,CAAC,IAAI,CAAC,IAAI,mBAAO,CAAC,OAAO,CAAA;QACzD,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;QAE3C,0FAA0F;QAC1F,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,CAAA;QArB7C,iBAAY,GAAG,IAAI,CAAA;QAuBjB,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;QACzC,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,IAAI,GAAG,OAAO,IAAI,mBAAO,CAAC,QAAQ,CAAA;QACvC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAA;IACxB,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,GAAY;QAC5B,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAK,GAAW,CAAC,YAAY,CAAC,CAAA;IACxE,CAAC;;AAxCH,4BAyCC;AAlCe,cAAK,GAAG,qBAAa,AAAhB,CAAgB;AACrB,cAAK,GAAG,qBAAa,AAAhB,CAAgB"}
|
|
@@ -4,7 +4,7 @@ type Options = ModuleServiceInitializeOptions["database"];
|
|
|
4
4
|
* Create a new knex (pg in the future) connection which can be reused and shared
|
|
5
5
|
* @param options
|
|
6
6
|
*/
|
|
7
|
-
export declare function createPgConnection(options: Options): import("
|
|
7
|
+
export declare function createPgConnection(options: Options): import("@mikro-orm/postgresql").Knex<any, any>;
|
|
8
8
|
export declare const isSharedConnectionSymbol: unique symbol;
|
|
9
9
|
export {};
|
|
10
10
|
//# sourceMappingURL=create-pg-connection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-pg-connection.d.ts","sourceRoot":"","sources":["../../src/modules-sdk/create-pg-connection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,cAAc,CAAA;AAG7D,KAAK,OAAO,GAAG,8BAA8B,CAAC,UAAU,CAAC,CAAA;AAEzD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"create-pg-connection.d.ts","sourceRoot":"","sources":["../../src/modules-sdk/create-pg-connection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,cAAc,CAAA;AAG7D,KAAK,OAAO,GAAG,8BAA8B,CAAC,UAAU,CAAC,CAAA;AAEzD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,kDAuBlD;AAED,eAAO,MAAM,wBAAwB,eAAmC,CAAA"}
|
package/dist/pg/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare function parseConnectionString(connectionString: string): import(
|
|
|
8
8
|
* Creates a PostgreSQL database client using the connection
|
|
9
9
|
* string or database options
|
|
10
10
|
*/
|
|
11
|
-
export declare function createClient(options: string | ClientConfig):
|
|
11
|
+
export declare function createClient(options: string | ClientConfig): any;
|
|
12
12
|
/**
|
|
13
13
|
* Creates a database using the client. Make sure to call
|
|
14
14
|
* `client.connect` before using this utility.
|
package/dist/pg/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pg/index.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,IAAI,CAAA;AAG9C;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,gBAAgB,EAAE,MAAM,oDAE7D;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pg/index.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,IAAI,CAAA;AAG9C;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,gBAAgB,EAAE,MAAM,oDAE7D;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,OAE1D;AAED;;;GAGG;AACH,wBAAsB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,iBAElE;AAED;;;GAGG;AACH,wBAAsB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,oBAKlE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../src/bundles.ts","../src/index.ts","../src/api-key/api-key-type.ts","../src/api-key/index.ts","../src/auth/abstract-auth-provider.ts","../src/auth/index.ts","../src/auth/token.ts","../src/common/alter-columns-helper.ts","../src/common/array-difference.ts","../src/common/array-intersection.ts","../src/common/big-number.ts","../src/common/build-query.ts","../src/common/build-regexp-if-valid.ts","../src/common/camel-to-snake-case.ts","../src/common/container.ts","../src/common/convert-item-response-to-update-request.ts","../src/common/create-container-like.ts","../src/common/create-psql-index-helper.ts","../src/common/create-raw-properties-from-bignumber.ts","../src/common/deduplicate.ts","../src/common/deep-copy.ts","../src/common/deep-equal-obj.ts","../src/common/deep-flat-map.ts","../src/common/deep-merge.ts","../src/common/define-config.ts","../src/common/dynamic-import.ts","../src/common/env-editor.ts","../src/common/errors.ts","../src/common/eto-container.ts","../src/common/file-system.ts","../src/common/filter-object-by-keys.ts","../src/common/filter-operator-map.ts","../src/common/flatten-object-to-key-value-pairs.ts","../src/common/generate-entity-id.ts","../src/common/get-caller-file-path.ts","../src/common/get-config-file.ts","../src/common/get-duplicates.ts","../src/common/get-iso-string-from-date.ts","../src/common/get-node-version.ts","../src/common/get-selects-and-relations-from-object-array.ts","../src/common/get-set-difference.ts","../src/common/graceful-shutdown-server.ts","../src/common/group-by.ts","../src/common/handle-postgres-database-error.ts","../src/common/index.ts","../src/common/is-big-number.ts","../src/common/is-boolean.ts","../src/common/is-date.ts","../src/common/is-defined.ts","../src/common/is-email.ts","../src/common/is-error-like.ts","../src/common/is-object.ts","../src/common/is-present.ts","../src/common/is-string.ts","../src/common/is-truthy.ts","../src/common/load-env.ts","../src/common/lower-case-first.ts","../src/common/map-object-to.ts","../src/common/math.ts","../src/common/merge-plugin-modules.ts","../src/common/normalize-import-path-with-source.ts","../src/common/object-from-string-path.ts","../src/common/object-to-string-path.ts","../src/common/omit-deep.ts","../src/common/optional-numeric-serializer.ts","../src/common/parse-cors-origins.ts","../src/common/partition-array.ts","../src/common/pick-deep.ts","../src/common/pick-value-from-object.ts","../src/common/plurailze.ts","../src/common/prefix-array-items.ts","../src/common/promise-all.ts","../src/common/read-dir-recursive.ts","../src/common/remote-query-object-from-string.ts","../src/common/remote-query-object-to-string.ts","../src/common/remove-nullisih.ts","../src/common/remove-undefined-properties.ts","../src/common/remove-undefined.ts","../src/common/resolve-exports.ts","../src/common/rules.ts","../src/common/selector-constraints-to-string.ts","../src/common/serialize-error.ts","../src/common/set-metadata.ts","../src/common/simple-hash.ts","../src/common/string-to-select-relation-object.ts","../src/common/stringify-circular.ts","../src/common/to-camel-case.ts","../src/common/to-handle.ts","../src/common/to-kebab-case.ts","../src/common/to-pascal-case.ts","../src/common/transform-properties-to-bignumber.ts","../src/common/trim-zeros.ts","../src/common/upper-case-first.ts","../src/common/validate-handle.ts","../src/common/__fixtures__/define-config/github/index.ts","../src/common/__tests__/array-intersection.spec.ts","../src/common/__tests__/build-query.spec.ts","../src/common/__tests__/build-regexp-if-valid.spec.ts","../src/common/__tests__/convert-item-response-to-update-request.ts","../src/common/__tests__/create-psql-index-helper.spec.ts","../src/common/__tests__/deep-copy.spec.ts","../src/common/__tests__/deep-equal-obj.spec.ts","../src/common/__tests__/deep-flat-map.ts","../src/common/__tests__/deep-merge.ts","../src/common/__tests__/define-config.spec.ts","../src/common/__tests__/env-editor.spec.ts","../src/common/__tests__/filter-object-by-keys.spec.ts","../src/common/__tests__/flatten-object-to-key-value-pairs.spec.ts","../src/common/__tests__/get-duplicates.spec.ts","../src/common/__tests__/get-selects-and-relations-from-object-array.spec.ts","../src/common/__tests__/graceful-shutdown-server.ts","../src/common/__tests__/group-by.spec.ts","../src/common/__tests__/handle-postgres-database-error.spec.ts","../src/common/__tests__/is-email.spec.ts","../src/common/__tests__/is-present.spec.ts","../src/common/__tests__/is-valid-handle.spec.ts","../src/common/__tests__/load-env.spec.ts","../src/common/__tests__/map-object-to.ts","../src/common/__tests__/object-to-string-path.spec.ts","../src/common/__tests__/omit-deep.spec.ts","../src/common/__tests__/parse-cors-origins.spec.ts","../src/common/__tests__/partition-array.spec.ts","../src/common/__tests__/pick-value-from-object.spec.ts","../src/common/__tests__/pluralize.spec.ts","../src/common/__tests__/promise-all.spec.ts","../src/common/__tests__/read-dir-recursive.spec.ts","../src/common/__tests__/remote-query-object-from-string.spec.ts","../src/common/__tests__/remote-query-object-to-string.spec.ts","../src/common/__tests__/remove-undefined-properties.spec.ts","../src/common/__tests__/remove-undefined.spec.ts","../src/common/__tests__/string-to-select-relation-object.ts","../src/common/__tests__/to-camel-case.spec.ts","../src/common/__tests__/to-handle.spec.ts","../src/common/__tests__/transform-modules.spec.ts","../src/common/__tests__/upper-case-first.spec.ts","../src/core-flows/events.ts","../src/core-flows/index.ts","../src/dal/index.ts","../src/dal/utils.ts","../src/dal/mikro-orm/base-entity.ts","../src/dal/mikro-orm/big-number-field.ts","../src/dal/mikro-orm/db-error-mapper.ts","../src/dal/mikro-orm/mikro-orm-create-connection.ts","../src/dal/mikro-orm/mikro-orm-free-text-search-filter.ts","../src/dal/mikro-orm/mikro-orm-repository.ts","../src/dal/mikro-orm/mikro-orm-serializer.ts","../src/dal/mikro-orm/mikro-orm-soft-deletable-filter.ts","../src/dal/mikro-orm/sql-migration-generator.ts","../src/dal/mikro-orm/utils.ts","../src/dal/mikro-orm/__fixtures__/utils.ts","../src/dal/mikro-orm/__tests__/base-entity.spec.ts","../src/dal/mikro-orm/__tests__/big-number-field.spec.ts","../src/dal/mikro-orm/__tests__/mikro-orm-free-text-search-filter.spec.ts","../src/dal/mikro-orm/__tests__/mikro-orm-serializer.spec.ts","../src/dal/mikro-orm/__tests__/ts-migration-generator.spec.ts","../src/dal/mikro-orm/decorators/foreign-key.ts","../src/dal/mikro-orm/decorators/searchable.ts","../src/dal/mikro-orm/integration-tests/__fixtures__/database.ts","../src/dal/mikro-orm/integration-tests/__fixtures__/utils.ts","../src/dal/mikro-orm/integration-tests/__tests__/mikro-orm-repository.spec.ts","../src/dal/mikro-orm/integration-tests/__tests__/utils.spec.ts","../src/defaults/countries.ts","../src/defaults/currencies.ts","../src/defaults/index.ts","../src/dml/entity-builder.ts","../src/dml/entity.ts","../src/dml/errors.ts","../src/dml/index.ts","../src/dml/__tests__/array-property.spec.ts","../src/dml/__tests__/autoincrement-property.spec.ts","../src/dml/__tests__/base-property.spec.ts","../src/dml/__tests__/base-relationship.spec.ts","../src/dml/__tests__/big-number-property.spec.ts","../src/dml/__tests__/boolean-property.spec.ts","../src/dml/__tests__/create-graphql.spec.ts","../src/dml/__tests__/date-time-property.spec.ts","../src/dml/__tests__/entity-builder.spec.ts","../src/dml/__tests__/enum-schema.spec.ts","../src/dml/__tests__/float-property.spec.ts","../src/dml/__tests__/has-many-relationship.spec.ts","../src/dml/__tests__/has-one-relationship.spec.ts","../src/dml/__tests__/id-property.spec.ts","../src/dml/__tests__/json-property.spec.ts","../src/dml/__tests__/many-to-many.spec.ts","../src/dml/__tests__/number-property.spec.ts","../src/dml/__tests__/text-property.spec.ts","../src/dml/helpers/create-graphql.ts","../src/dml/helpers/create-mikro-orm-entity.ts","../src/dml/helpers/entity-builder/apply-searchable.ts","../src/dml/helpers/entity-builder/build-indexes.ts","../src/dml/helpers/entity-builder/create-big-number-properties.ts","../src/dml/helpers/entity-builder/create-default-properties.ts","../src/dml/helpers/entity-builder/define-property.ts","../src/dml/helpers/entity-builder/define-relationship.ts","../src/dml/helpers/entity-builder/index.ts","../src/dml/helpers/entity-builder/parse-entity-name.ts","../src/dml/helpers/entity-builder/query-builder.ts","../src/dml/helpers/graphql-builder/get-attribute.ts","../src/dml/helpers/graphql-builder/set-relationship.ts","../src/dml/helpers/mikro-orm/apply-checks.ts","../src/dml/helpers/mikro-orm/apply-indexes.ts","../src/dml/helpers/mikro-orm/build-indexes.ts","../src/dml/integration-tests/utils.ts","../src/dml/integration-tests/__tests__/entity.spec.ts","../src/dml/integration-tests/__tests__/enum.spec.ts","../src/dml/integration-tests/__tests__/has-one-belongs-to.spec.ts","../src/dml/integration-tests/__tests__/many-to-many.spec.ts","../src/dml/integration-tests/__tests__/many-to-one.spec.ts","../src/dml/properties/array.ts","../src/dml/properties/autoincrement.ts","../src/dml/properties/base.ts","../src/dml/properties/big-number.ts","../src/dml/properties/boolean.ts","../src/dml/properties/computed.ts","../src/dml/properties/date-time.ts","../src/dml/properties/enum.ts","../src/dml/properties/float.ts","../src/dml/properties/id.ts","../src/dml/properties/index.ts","../src/dml/properties/json.ts","../src/dml/properties/nullable.ts","../src/dml/properties/number.ts","../src/dml/properties/primary-key.ts","../src/dml/properties/text.ts","../src/dml/properties/vector.ts","../src/dml/relations/base.ts","../src/dml/relations/belongs-to.ts","../src/dml/relations/has-many.ts","../src/dml/relations/has-one-fk.ts","../src/dml/relations/has-one.ts","../src/dml/relations/index.ts","../src/dml/relations/many-to-many.ts","../src/dml/relations/nullable.ts","../src/event-bus/build-event-messages.ts","../src/event-bus/common-events.ts","../src/event-bus/index.ts","../src/event-bus/message-aggregator.ts","../src/event-bus/utils.ts","../src/event-bus/__tests__/build-event-names-from-entity-name.spec.ts","../src/event-bus/__tests__/message-aggregator.spec.ts","../src/exceptions/index.ts","../src/exceptions/is-duplicate-error.ts","../src/exceptions/postgres-error.ts","../src/feature-flags/analytics.ts","../src/feature-flags/index.ts","../src/feature-flags/publishable-api-keys.ts","../src/feature-flags/workflows.ts","../src/feature-flags/utils/flag-router.ts","../src/feature-flags/utils/index.ts","../src/file/abstract-file-provider.ts","../src/file/index.ts","../src/graphql/clean-graphql.ts","../src/graphql/extract-relations-from-graphql.ts","../src/graphql/get-fields-and-relations.ts","../src/graphql/graphql-parser.ts","../src/graphql/graphql-to-fields.ts","../src/graphql/graphql-to-ts-types.ts","../src/graphql/index.ts","../src/graphql/__tests__/clean-graphql-schema.spec.ts","../src/graphql/__tests__/graphql-ast.ts","../src/graphql/__tests__/utils/gql-get-fields-and-relations.spec.ts","../src/graphql/__tests__/utils/graphql-schema-to-fields.ts","../src/link/compose-link-name.ts","../src/link/index.ts","../src/migrations/index.ts","../src/migrations/integration-tests/__tests__/migrations-generate.spec.ts","../src/migrations/integration-tests/__tests__/migrations-revert.spec.ts","../src/migrations/integration-tests/__tests__/migrations-run.spec.ts","../src/modules-sdk/build-query.ts","../src/modules-sdk/create-pg-connection.ts","../src/modules-sdk/define-link.ts","../src/modules-sdk/definition.ts","../src/modules-sdk/eto-internal-service.ts","../src/modules-sdk/eto-service.ts","../src/modules-sdk/event-builder-factory.ts","../src/modules-sdk/index.ts","../src/modules-sdk/joiner-config-builder.ts","../src/modules-sdk/load-module-database-config.ts","../src/modules-sdk/mikro-orm-cli-config-builder.ts","../src/modules-sdk/module-provider-registration-key.ts","../src/modules-sdk/module-provider.ts","../src/modules-sdk/module.ts","../src/modules-sdk/modules-to-container-types.ts","../src/modules-sdk/query-context.ts","../src/modules-sdk/__fixtures__/joiner-config/entities.ts","../src/modules-sdk/__tests__/build-query.spec.ts","../src/modules-sdk/__tests__/eto-internal-service.ts","../src/modules-sdk/__tests__/eto-service.spec.ts","../src/modules-sdk/__tests__/joiner-config-builder.spec.ts","../src/modules-sdk/__tests__/load-database-config.spec.ts","../src/modules-sdk/__tests__/mikro-orm-cli-config-builder.spec.ts","../src/modules-sdk/__tests__/modules-to-container-types.spec.ts","../src/modules-sdk/decorators/context-parameter.ts","../src/modules-sdk/decorators/emit-events.ts","../src/modules-sdk/decorators/index.ts","../src/modules-sdk/decorators/inject-into-context.ts","../src/modules-sdk/decorators/inject-manager.ts","../src/modules-sdk/decorators/inject-shared-context.ts","../src/modules-sdk/decorators/inject-transaction-manager.ts","../src/modules-sdk/decorators/module.ts","../src/modules-sdk/decorators/__tests__/emit-events.ts","../src/modules-sdk/loaders/container-loader-factory.ts","../src/modules-sdk/loaders/load-models.ts","../src/modules-sdk/loaders/mikro-orm-connection-loader-factory.ts","../src/modules-sdk/loaders/mikro-orm-connection-loader.ts","../src/modules-sdk/migration-scripts/index.ts","../src/modules-sdk/migration-scripts/migration-down.ts","../src/modules-sdk/migration-scripts/migration-generate.ts","../src/modules-sdk/migration-scripts/migration-up.ts","../src/modules-sdk/migration-scripts/seed.ts","../src/modules-sdk/types/eto-service.ts","../src/modules-sdk/types/links-config.ts","../src/notification/abstract-notification-provider.ts","../src/notification/common.ts","../src/notification/events.ts","../src/notification/index.ts","../src/orchestration/index.ts","../src/orchestration/symbol.ts","../src/orchestration/types.ts","../src/payment/abstract-payment-provider.ts","../src/payment/events.ts","../src/payment/get-smallest-unit.ts","../src/payment/index.ts","../src/payment/payment-collection.ts","../src/payment/payment-session.ts","../src/payment/webhook.ts","../src/pg/index.ts","../src/pg/integration-tests/__tests__/pg_utils.spec.ts","../src/search/abstract-service.ts","../src/search/index-types.ts","../src/search/index.ts","../src/search/search-relations.ts","../src/search/variant-keys.ts","../src/user/events.ts","../src/user/index.ts"],"version":"5.8.3"}
|
|
1
|
+
{"root":["../src/bundles.ts","../src/index.ts","../src/api-key/api-key-type.ts","../src/api-key/index.ts","../src/auth/abstract-auth-provider.ts","../src/auth/index.ts","../src/auth/token.ts","../src/common/alter-columns-helper.ts","../src/common/api-error.ts","../src/common/array-difference.ts","../src/common/array-intersection.ts","../src/common/big-number.ts","../src/common/build-query.ts","../src/common/build-regexp-if-valid.ts","../src/common/camel-to-snake-case.ts","../src/common/container.ts","../src/common/convert-item-response-to-update-request.ts","../src/common/create-container-like.ts","../src/common/create-psql-index-helper.ts","../src/common/create-raw-properties-from-bignumber.ts","../src/common/deduplicate.ts","../src/common/deep-copy.ts","../src/common/deep-equal-obj.ts","../src/common/deep-flat-map.ts","../src/common/deep-merge.ts","../src/common/define-config.ts","../src/common/dynamic-import.ts","../src/common/env-editor.ts","../src/common/errors.ts","../src/common/eto-container.ts","../src/common/file-system.ts","../src/common/filter-object-by-keys.ts","../src/common/filter-operator-map.ts","../src/common/flatten-object-to-key-value-pairs.ts","../src/common/generate-entity-id.ts","../src/common/get-caller-file-path.ts","../src/common/get-config-file.ts","../src/common/get-duplicates.ts","../src/common/get-iso-string-from-date.ts","../src/common/get-node-version.ts","../src/common/get-selects-and-relations-from-object-array.ts","../src/common/get-set-difference.ts","../src/common/graceful-shutdown-server.ts","../src/common/group-by.ts","../src/common/handle-postgres-database-error.ts","../src/common/index.ts","../src/common/is-big-number.ts","../src/common/is-boolean.ts","../src/common/is-date.ts","../src/common/is-defined.ts","../src/common/is-email.ts","../src/common/is-error-like.ts","../src/common/is-object.ts","../src/common/is-present.ts","../src/common/is-string.ts","../src/common/is-truthy.ts","../src/common/load-env.ts","../src/common/lower-case-first.ts","../src/common/map-object-to.ts","../src/common/math.ts","../src/common/merge-plugin-modules.ts","../src/common/normalize-import-path-with-source.ts","../src/common/object-from-string-path.ts","../src/common/object-to-string-path.ts","../src/common/omit-deep.ts","../src/common/optional-numeric-serializer.ts","../src/common/parse-cors-origins.ts","../src/common/partition-array.ts","../src/common/pick-deep.ts","../src/common/pick-value-from-object.ts","../src/common/plurailze.ts","../src/common/prefix-array-items.ts","../src/common/promise-all.ts","../src/common/read-dir-recursive.ts","../src/common/remote-query-object-from-string.ts","../src/common/remote-query-object-to-string.ts","../src/common/remove-nullisih.ts","../src/common/remove-undefined-properties.ts","../src/common/remove-undefined.ts","../src/common/resolve-exports.ts","../src/common/rules.ts","../src/common/selector-constraints-to-string.ts","../src/common/serialize-error.ts","../src/common/set-metadata.ts","../src/common/simple-hash.ts","../src/common/string-to-select-relation-object.ts","../src/common/stringify-circular.ts","../src/common/to-camel-case.ts","../src/common/to-handle.ts","../src/common/to-kebab-case.ts","../src/common/to-pascal-case.ts","../src/common/transform-properties-to-bignumber.ts","../src/common/trim-zeros.ts","../src/common/upper-case-first.ts","../src/common/validate-handle.ts","../src/common/__fixtures__/define-config/github/index.ts","../src/common/__tests__/array-intersection.spec.ts","../src/common/__tests__/build-query.spec.ts","../src/common/__tests__/build-regexp-if-valid.spec.ts","../src/common/__tests__/convert-item-response-to-update-request.ts","../src/common/__tests__/create-psql-index-helper.spec.ts","../src/common/__tests__/deep-copy.spec.ts","../src/common/__tests__/deep-equal-obj.spec.ts","../src/common/__tests__/deep-flat-map.ts","../src/common/__tests__/deep-merge.ts","../src/common/__tests__/define-config.spec.ts","../src/common/__tests__/env-editor.spec.ts","../src/common/__tests__/filter-object-by-keys.spec.ts","../src/common/__tests__/flatten-object-to-key-value-pairs.spec.ts","../src/common/__tests__/get-duplicates.spec.ts","../src/common/__tests__/get-selects-and-relations-from-object-array.spec.ts","../src/common/__tests__/graceful-shutdown-server.ts","../src/common/__tests__/group-by.spec.ts","../src/common/__tests__/handle-postgres-database-error.spec.ts","../src/common/__tests__/is-email.spec.ts","../src/common/__tests__/is-present.spec.ts","../src/common/__tests__/is-valid-handle.spec.ts","../src/common/__tests__/load-env.spec.ts","../src/common/__tests__/map-object-to.ts","../src/common/__tests__/object-to-string-path.spec.ts","../src/common/__tests__/omit-deep.spec.ts","../src/common/__tests__/parse-cors-origins.spec.ts","../src/common/__tests__/partition-array.spec.ts","../src/common/__tests__/pick-value-from-object.spec.ts","../src/common/__tests__/pluralize.spec.ts","../src/common/__tests__/promise-all.spec.ts","../src/common/__tests__/read-dir-recursive.spec.ts","../src/common/__tests__/remote-query-object-from-string.spec.ts","../src/common/__tests__/remote-query-object-to-string.spec.ts","../src/common/__tests__/remove-undefined-properties.spec.ts","../src/common/__tests__/remove-undefined.spec.ts","../src/common/__tests__/string-to-select-relation-object.ts","../src/common/__tests__/to-camel-case.spec.ts","../src/common/__tests__/to-handle.spec.ts","../src/common/__tests__/transform-modules.spec.ts","../src/common/__tests__/upper-case-first.spec.ts","../src/core-flows/events.ts","../src/core-flows/index.ts","../src/dal/index.ts","../src/dal/utils.ts","../src/dal/mikro-orm/base-entity.ts","../src/dal/mikro-orm/big-number-field.ts","../src/dal/mikro-orm/db-error-mapper.ts","../src/dal/mikro-orm/mikro-orm-create-connection.ts","../src/dal/mikro-orm/mikro-orm-free-text-search-filter.ts","../src/dal/mikro-orm/mikro-orm-repository.ts","../src/dal/mikro-orm/mikro-orm-serializer.ts","../src/dal/mikro-orm/mikro-orm-soft-deletable-filter.ts","../src/dal/mikro-orm/sql-migration-generator.ts","../src/dal/mikro-orm/utils.ts","../src/dal/mikro-orm/__fixtures__/utils.ts","../src/dal/mikro-orm/__tests__/base-entity.spec.ts","../src/dal/mikro-orm/__tests__/big-number-field.spec.ts","../src/dal/mikro-orm/__tests__/mikro-orm-free-text-search-filter.spec.ts","../src/dal/mikro-orm/__tests__/mikro-orm-serializer.spec.ts","../src/dal/mikro-orm/__tests__/ts-migration-generator.spec.ts","../src/dal/mikro-orm/decorators/foreign-key.ts","../src/dal/mikro-orm/decorators/searchable.ts","../src/dal/mikro-orm/integration-tests/__fixtures__/database.ts","../src/dal/mikro-orm/integration-tests/__fixtures__/utils.ts","../src/dal/mikro-orm/integration-tests/__tests__/mikro-orm-repository.spec.ts","../src/dal/mikro-orm/integration-tests/__tests__/utils.spec.ts","../src/defaults/countries.ts","../src/defaults/currencies.ts","../src/defaults/index.ts","../src/dml/entity-builder.ts","../src/dml/entity.ts","../src/dml/errors.ts","../src/dml/index.ts","../src/dml/__tests__/array-property.spec.ts","../src/dml/__tests__/autoincrement-property.spec.ts","../src/dml/__tests__/base-property.spec.ts","../src/dml/__tests__/base-relationship.spec.ts","../src/dml/__tests__/big-number-property.spec.ts","../src/dml/__tests__/boolean-property.spec.ts","../src/dml/__tests__/create-graphql.spec.ts","../src/dml/__tests__/date-time-property.spec.ts","../src/dml/__tests__/entity-builder.spec.ts","../src/dml/__tests__/enum-schema.spec.ts","../src/dml/__tests__/float-property.spec.ts","../src/dml/__tests__/has-many-relationship.spec.ts","../src/dml/__tests__/has-one-relationship.spec.ts","../src/dml/__tests__/id-property.spec.ts","../src/dml/__tests__/json-property.spec.ts","../src/dml/__tests__/many-to-many.spec.ts","../src/dml/__tests__/number-property.spec.ts","../src/dml/__tests__/text-property.spec.ts","../src/dml/helpers/create-graphql.ts","../src/dml/helpers/create-mikro-orm-entity.ts","../src/dml/helpers/entity-builder/apply-searchable.ts","../src/dml/helpers/entity-builder/build-indexes.ts","../src/dml/helpers/entity-builder/create-big-number-properties.ts","../src/dml/helpers/entity-builder/create-default-properties.ts","../src/dml/helpers/entity-builder/define-property.ts","../src/dml/helpers/entity-builder/define-relationship.ts","../src/dml/helpers/entity-builder/index.ts","../src/dml/helpers/entity-builder/parse-entity-name.ts","../src/dml/helpers/entity-builder/query-builder.ts","../src/dml/helpers/graphql-builder/get-attribute.ts","../src/dml/helpers/graphql-builder/set-relationship.ts","../src/dml/helpers/mikro-orm/apply-checks.ts","../src/dml/helpers/mikro-orm/apply-indexes.ts","../src/dml/helpers/mikro-orm/build-indexes.ts","../src/dml/integration-tests/utils.ts","../src/dml/integration-tests/__tests__/entity.spec.ts","../src/dml/integration-tests/__tests__/enum.spec.ts","../src/dml/integration-tests/__tests__/has-one-belongs-to.spec.ts","../src/dml/integration-tests/__tests__/many-to-many.spec.ts","../src/dml/integration-tests/__tests__/many-to-one.spec.ts","../src/dml/properties/array.ts","../src/dml/properties/autoincrement.ts","../src/dml/properties/base.ts","../src/dml/properties/big-number.ts","../src/dml/properties/boolean.ts","../src/dml/properties/computed.ts","../src/dml/properties/date-time.ts","../src/dml/properties/enum.ts","../src/dml/properties/float.ts","../src/dml/properties/id.ts","../src/dml/properties/index.ts","../src/dml/properties/json.ts","../src/dml/properties/nullable.ts","../src/dml/properties/number.ts","../src/dml/properties/primary-key.ts","../src/dml/properties/text.ts","../src/dml/properties/vector.ts","../src/dml/relations/base.ts","../src/dml/relations/belongs-to.ts","../src/dml/relations/has-many.ts","../src/dml/relations/has-one-fk.ts","../src/dml/relations/has-one.ts","../src/dml/relations/index.ts","../src/dml/relations/many-to-many.ts","../src/dml/relations/nullable.ts","../src/event-bus/build-event-messages.ts","../src/event-bus/common-events.ts","../src/event-bus/index.ts","../src/event-bus/message-aggregator.ts","../src/event-bus/utils.ts","../src/event-bus/__tests__/build-event-names-from-entity-name.spec.ts","../src/event-bus/__tests__/message-aggregator.spec.ts","../src/exceptions/index.ts","../src/exceptions/is-duplicate-error.ts","../src/exceptions/postgres-error.ts","../src/feature-flags/analytics.ts","../src/feature-flags/index.ts","../src/feature-flags/publishable-api-keys.ts","../src/feature-flags/workflows.ts","../src/feature-flags/utils/flag-router.ts","../src/feature-flags/utils/index.ts","../src/file/abstract-file-provider.ts","../src/file/index.ts","../src/graphql/clean-graphql.ts","../src/graphql/extract-relations-from-graphql.ts","../src/graphql/get-fields-and-relations.ts","../src/graphql/graphql-parser.ts","../src/graphql/graphql-to-fields.ts","../src/graphql/graphql-to-ts-types.ts","../src/graphql/index.ts","../src/graphql/__tests__/clean-graphql-schema.spec.ts","../src/graphql/__tests__/graphql-ast.ts","../src/graphql/__tests__/utils/gql-get-fields-and-relations.spec.ts","../src/graphql/__tests__/utils/graphql-schema-to-fields.ts","../src/link/compose-link-name.ts","../src/link/index.ts","../src/migrations/index.ts","../src/migrations/integration-tests/__tests__/migrations-generate.spec.ts","../src/migrations/integration-tests/__tests__/migrations-revert.spec.ts","../src/migrations/integration-tests/__tests__/migrations-run.spec.ts","../src/modules-sdk/build-query.ts","../src/modules-sdk/create-pg-connection.ts","../src/modules-sdk/define-link.ts","../src/modules-sdk/definition.ts","../src/modules-sdk/eto-internal-service.ts","../src/modules-sdk/eto-service.ts","../src/modules-sdk/event-builder-factory.ts","../src/modules-sdk/index.ts","../src/modules-sdk/joiner-config-builder.ts","../src/modules-sdk/load-module-database-config.ts","../src/modules-sdk/mikro-orm-cli-config-builder.ts","../src/modules-sdk/module-provider-registration-key.ts","../src/modules-sdk/module-provider.ts","../src/modules-sdk/module.ts","../src/modules-sdk/modules-to-container-types.ts","../src/modules-sdk/query-context.ts","../src/modules-sdk/__fixtures__/joiner-config/entities.ts","../src/modules-sdk/__tests__/build-query.spec.ts","../src/modules-sdk/__tests__/eto-internal-service.ts","../src/modules-sdk/__tests__/eto-service.spec.ts","../src/modules-sdk/__tests__/joiner-config-builder.spec.ts","../src/modules-sdk/__tests__/load-database-config.spec.ts","../src/modules-sdk/__tests__/mikro-orm-cli-config-builder.spec.ts","../src/modules-sdk/__tests__/modules-to-container-types.spec.ts","../src/modules-sdk/decorators/context-parameter.ts","../src/modules-sdk/decorators/emit-events.ts","../src/modules-sdk/decorators/index.ts","../src/modules-sdk/decorators/inject-into-context.ts","../src/modules-sdk/decorators/inject-manager.ts","../src/modules-sdk/decorators/inject-shared-context.ts","../src/modules-sdk/decorators/inject-transaction-manager.ts","../src/modules-sdk/decorators/module.ts","../src/modules-sdk/decorators/__tests__/emit-events.ts","../src/modules-sdk/loaders/container-loader-factory.ts","../src/modules-sdk/loaders/load-models.ts","../src/modules-sdk/loaders/mikro-orm-connection-loader-factory.ts","../src/modules-sdk/loaders/mikro-orm-connection-loader.ts","../src/modules-sdk/migration-scripts/index.ts","../src/modules-sdk/migration-scripts/migration-down.ts","../src/modules-sdk/migration-scripts/migration-generate.ts","../src/modules-sdk/migration-scripts/migration-up.ts","../src/modules-sdk/migration-scripts/seed.ts","../src/modules-sdk/types/eto-service.ts","../src/modules-sdk/types/links-config.ts","../src/notification/abstract-notification-provider.ts","../src/notification/common.ts","../src/notification/events.ts","../src/notification/index.ts","../src/orchestration/index.ts","../src/orchestration/symbol.ts","../src/orchestration/types.ts","../src/payment/abstract-payment-provider.ts","../src/payment/events.ts","../src/payment/get-smallest-unit.ts","../src/payment/index.ts","../src/payment/payment-collection.ts","../src/payment/payment-session.ts","../src/payment/webhook.ts","../src/pg/index.ts","../src/pg/integration-tests/__tests__/pg_utils.spec.ts","../src/search/abstract-service.ts","../src/search/index-types.ts","../src/search/index.ts","../src/search/search-relations.ts","../src/search/variant-keys.ts","../src/user/events.ts","../src/user/index.ts"],"version":"5.8.3"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etohq/utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Eto utilities functions shared by Eto core and Modules",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -30,46 +30,49 @@
|
|
|
30
30
|
"@mikro-orm/knex": "5.9.7",
|
|
31
31
|
"@mikro-orm/migrations": "5.9.7",
|
|
32
32
|
"@mikro-orm/postgresql": "5.9.7",
|
|
33
|
-
"@swc/core": "
|
|
34
|
-
"@swc/jest": "
|
|
35
|
-
"@types/jest": "
|
|
36
|
-
"@types/node": "
|
|
37
|
-
"awilix": "
|
|
38
|
-
"expect-type": "
|
|
39
|
-
"jest": "
|
|
40
|
-
"pg": "
|
|
41
|
-
"pg-god": "
|
|
42
|
-
"
|
|
43
|
-
"
|
|
33
|
+
"@swc/core": "1.7.28",
|
|
34
|
+
"@swc/jest": "0.2.36",
|
|
35
|
+
"@types/jest": "29.5.14",
|
|
36
|
+
"@types/node": "22.10.5",
|
|
37
|
+
"awilix": "8.0.1",
|
|
38
|
+
"expect-type": "0.20.0",
|
|
39
|
+
"jest": "29.7.0",
|
|
40
|
+
"pg": "8.13.0",
|
|
41
|
+
"pg-god": "1.0.12",
|
|
42
|
+
"tsc-alias": "1.8.6",
|
|
43
|
+
"rimraf": "5.0.2",
|
|
44
|
+
"typescript": "5.8.3"
|
|
44
45
|
},
|
|
45
46
|
"dependencies": {
|
|
46
|
-
"@
|
|
47
|
-
"@graphql-codegen/
|
|
48
|
-
"@graphql-
|
|
49
|
-
"@graphql-tools/
|
|
50
|
-
"@
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"dotenv": "
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"ulid": "
|
|
47
|
+
"@graphql-codegen/core": "4.0.2",
|
|
48
|
+
"@graphql-codegen/typescript": "4.0.9",
|
|
49
|
+
"@graphql-tools/merge": "9.0.7",
|
|
50
|
+
"@graphql-tools/schema": "10.0.6",
|
|
51
|
+
"@types/pluralize": "0.0.33",
|
|
52
|
+
"bignumber.js": "9.1.2",
|
|
53
|
+
"dotenv": "16.4.5",
|
|
54
|
+
"dotenv-expand": "11.0.6",
|
|
55
|
+
"graphql": "16.9.0",
|
|
56
|
+
"jsonwebtoken": "9.0.2",
|
|
57
|
+
"pg-connection-string": "2.7.0",
|
|
58
|
+
"pluralize": "8.0.0",
|
|
59
|
+
"fs-extra": "10.0.0",
|
|
60
|
+
"ulid": "2.3.0",
|
|
61
|
+
"@etohq/types": "1.4.0"
|
|
60
62
|
},
|
|
61
63
|
"peerDependencies": {
|
|
62
64
|
"@mikro-orm/core": "5.9.7",
|
|
63
65
|
"@mikro-orm/knex": "5.9.7",
|
|
64
66
|
"@mikro-orm/migrations": "5.9.7",
|
|
65
67
|
"@mikro-orm/postgresql": "5.9.7",
|
|
66
|
-
"awilix": "
|
|
67
|
-
"pg": "
|
|
68
|
+
"awilix": "8.0.1",
|
|
69
|
+
"pg": "8.13.0"
|
|
68
70
|
},
|
|
69
71
|
"scripts": {
|
|
70
|
-
"build": "rimraf dist && tsc --build",
|
|
72
|
+
"build": "rimraf dist && tsc --build && npm run resolve:aliases",
|
|
71
73
|
"watch": "tsc --build --watch",
|
|
74
|
+
"resolve:aliases": "tsc --showConfig -p tsconfig.json > tsconfig.resolved.json && tsc-alias -p tsconfig.resolved.json && rimraf tsconfig.resolved.json",
|
|
72
75
|
"test": "jest --silent --bail --maxWorkers=50% --forceExit --testPathIgnorePatterns='/integration-tests/' -- src/**/__tests__/**/*.ts",
|
|
73
76
|
"test:integration": "jest --silent --bail --runInBand --forceExit -- src/**/integration-tests/__tests__/**/*.ts"
|
|
74
77
|
}
|
|
75
|
-
}
|
|
78
|
+
}
|