@develit-io/backend-sdk 12.6.0 → 12.7.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/dist/index.d.mts +6 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.mjs +18 -28
- package/dist/sentry.d.mts +23 -0
- package/dist/sentry.d.ts +23 -0
- package/dist/sentry.mjs +49 -0
- package/dist/shared/backend-sdk.D6_sG5co.d.mts +10 -0
- package/dist/shared/backend-sdk.D6_sG5co.d.ts +10 -0
- package/dist/shared/backend-sdk.e9CWR7-E.mjs +39 -0
- package/package.json +15 -3
package/dist/index.d.mts
CHANGED
|
@@ -9,6 +9,7 @@ export { ContentfulStatusCode as InternalResponseStatus } from 'hono/utils/http-
|
|
|
9
9
|
import { Queue, MessageBatch } from '@cloudflare/workers-types';
|
|
10
10
|
import { BatchItem } from 'drizzle-orm/batch';
|
|
11
11
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
12
|
+
export { E as ErrorReportContext, a as ErrorReporter, r as reportError, s as setErrorReporter } from './shared/backend-sdk.D6_sG5co.mjs';
|
|
12
13
|
|
|
13
14
|
declare const ENVIRONMENT: string[];
|
|
14
15
|
|
|
@@ -40,7 +41,6 @@ declare const structuredAddressSchema: z$1.ZodObject<{
|
|
|
40
41
|
city: z$1.ZodOptional<z$1.ZodString>;
|
|
41
42
|
postalCode: z$1.ZodOptional<z$1.ZodString>;
|
|
42
43
|
countryCode: z$1.ZodOptional<z$1.ZodEnum<{
|
|
43
|
-
IM: "IM";
|
|
44
44
|
AF: "AF";
|
|
45
45
|
AL: "AL";
|
|
46
46
|
DZ: "DZ";
|
|
@@ -130,6 +130,7 @@ declare const structuredAddressSchema: z$1.ZodObject<{
|
|
|
130
130
|
IR: "IR";
|
|
131
131
|
IQ: "IQ";
|
|
132
132
|
IE: "IE";
|
|
133
|
+
IM: "IM";
|
|
133
134
|
IL: "IL";
|
|
134
135
|
IT: "IT";
|
|
135
136
|
CI: "CI";
|
|
@@ -330,7 +331,6 @@ declare const bankAccountMetadataSchema: z$1.ZodObject<{
|
|
|
330
331
|
city: z$1.ZodOptional<z$1.ZodString>;
|
|
331
332
|
postalCode: z$1.ZodOptional<z$1.ZodString>;
|
|
332
333
|
countryCode: z$1.ZodOptional<z$1.ZodEnum<{
|
|
333
|
-
IM: "IM";
|
|
334
334
|
AF: "AF";
|
|
335
335
|
AL: "AL";
|
|
336
336
|
DZ: "DZ";
|
|
@@ -420,6 +420,7 @@ declare const bankAccountMetadataSchema: z$1.ZodObject<{
|
|
|
420
420
|
IR: "IR";
|
|
421
421
|
IQ: "IQ";
|
|
422
422
|
IE: "IE";
|
|
423
|
+
IM: "IM";
|
|
423
424
|
IL: "IL";
|
|
424
425
|
IT: "IT";
|
|
425
426
|
CI: "CI";
|
|
@@ -602,7 +603,6 @@ declare const bankAccountMetadataSchema: z$1.ZodObject<{
|
|
|
602
603
|
AVAX: "AVAX";
|
|
603
604
|
}>>;
|
|
604
605
|
countryCode: z$1.ZodOptional<z$1.ZodEnum<{
|
|
605
|
-
IM: "IM";
|
|
606
606
|
AF: "AF";
|
|
607
607
|
AL: "AL";
|
|
608
608
|
DZ: "DZ";
|
|
@@ -692,6 +692,7 @@ declare const bankAccountMetadataSchema: z$1.ZodObject<{
|
|
|
692
692
|
IR: "IR";
|
|
693
693
|
IQ: "IQ";
|
|
694
694
|
IE: "IE";
|
|
695
|
+
IM: "IM";
|
|
695
696
|
IL: "IL";
|
|
696
697
|
IT: "IT";
|
|
697
698
|
CI: "CI";
|
|
@@ -833,7 +834,7 @@ declare const bankAccount: {
|
|
|
833
834
|
swiftBic: drizzle_orm_sqlite_core.SQLiteTextBuilder<[string, ...string[]]>;
|
|
834
835
|
bicCor: drizzle_orm_sqlite_core.SQLiteTextBuilder<[string, ...string[]]>;
|
|
835
836
|
currency: drizzle_orm.NotNull<drizzle_orm_sqlite_core.SQLiteTextBuilder<["CZK" | "EUR" | "USD" | "PLN" | "RON" | "GBP" | "RUB" | "HUF" | "CHF" | "DKK" | "SEK" | "HRK" | "NOK" | "BGN" | "TRY" | "AUD" | "CAD" | "JPY" | "CNY" | "INR" | "BRL" | "MXN" | "ZAR" | "SGD" | "HKD" | "KRW" | "MYR" | "THB" | "IDR" | "PHP" | "AED" | "SAR" | "ILS" | "EGP" | "NGN" | "PKR" | "COP" | "CLP" | "PEN" | "VND" | "KZT" | "UAH" | "BTC" | "ETH" | "ADA" | "DOT" | "ATOM" | "XRP" | "LTC" | "SOL" | "DOGE" | "MATIC" | "AVAX", ...("CZK" | "EUR" | "USD" | "PLN" | "RON" | "GBP" | "RUB" | "HUF" | "CHF" | "DKK" | "SEK" | "HRK" | "NOK" | "BGN" | "TRY" | "AUD" | "CAD" | "JPY" | "CNY" | "INR" | "BRL" | "MXN" | "ZAR" | "SGD" | "HKD" | "KRW" | "MYR" | "THB" | "IDR" | "PHP" | "AED" | "SAR" | "ILS" | "EGP" | "NGN" | "PKR" | "COP" | "CLP" | "PEN" | "VND" | "KZT" | "UAH" | "BTC" | "ETH" | "ADA" | "DOT" | "ATOM" | "XRP" | "LTC" | "SOL" | "DOGE" | "MATIC" | "AVAX")[]]>>;
|
|
836
|
-
countryCode: drizzle_orm.NotNull<drizzle_orm_sqlite_core.SQLiteTextBuilder<["
|
|
837
|
+
countryCode: drizzle_orm.NotNull<drizzle_orm_sqlite_core.SQLiteTextBuilder<["AF" | "AL" | "DZ" | "AS" | "AD" | "AO" | "AG" | "AR" | "AM" | "AW" | "AU" | "AT" | "AZ" | "BS" | "BH" | "BD" | "BB" | "BY" | "BE" | "BZ" | "BJ" | "BO" | "BQ" | "BA" | "BW" | "BR" | "IO" | "VG" | "BG" | "BF" | "BI" | "KH" | "CM" | "CA" | "CV" | "CF" | "TD" | "CL" | "CN" | "CO" | "KM" | "CK" | "CR" | "HR" | "CW" | "CY" | "CZ" | "CD" | "DK" | "DJ" | "DM" | "DO" | "TL" | "EC" | "EG" | "SV" | "GQ" | "ER" | "EE" | "ET" | "FO" | "FJ" | "FI" | "FR" | "GF" | "PF" | "GA" | "GM" | "GE" | "DE" | "GH" | "GR" | "GD" | "GP" | "GU" | "GT" | "GN" | "GW" | "GY" | "HT" | "HK" | "HN" | "HU" | "IS" | "IN" | "ID" | "IR" | "IQ" | "IE" | "IM" | "IL" | "IT" | "CI" | "JM" | "JP" | "JE" | "JO" | "KZ" | "KE" | "KI" | "XK" | "KW" | "KG" | "LA" | "LV" | "LB" | "LS" | "LR" | "LI" | "LT" | "LU" | "MK" | "MG" | "MW" | "MY" | "MV" | "ML" | "MT" | "MQ" | "MR" | "MU" | "MX" | "FM" | "MD" | "MC" | "MN" | "ME" | "MS" | "MA" | "MZ" | "NA" | "NP" | "NL" | "NZ" | "NI" | "NE" | "NG" | "NU" | "NF" | "KP" | "NO" | "OM" | "PK" | "PS" | "PA" | "PG" | "PY" | "PE" | "PH" | "PL" | "PT" | "PR" | "QA" | "CG" | "RE" | "RO" | "RU" | "RW" | "BL" | "KN" | "LC" | "MF" | "VC" | "WS" | "SM" | "SA" | "SN" | "RS" | "SC" | "SL" | "SG" | "SX" | "SK" | "SI" | "SO" | "ZA" | "KR" | "SS" | "ES" | "LK" | "SD" | "SR" | "SJ" | "SZ" | "SE" | "CH" | "TW" | "TJ" | "TZ" | "TH" | "TG" | "TO" | "TT" | "TN" | "TR" | "TM" | "UM" | "VI" | "UG" | "UA" | "AE" | "GB" | "US" | "UZ" | "VU" | "VE" | "VN" | "WF" | "EH" | "YE" | "ZM" | "ZW", ...("AF" | "AL" | "DZ" | "AS" | "AD" | "AO" | "AG" | "AR" | "AM" | "AW" | "AU" | "AT" | "AZ" | "BS" | "BH" | "BD" | "BB" | "BY" | "BE" | "BZ" | "BJ" | "BO" | "BQ" | "BA" | "BW" | "BR" | "IO" | "VG" | "BG" | "BF" | "BI" | "KH" | "CM" | "CA" | "CV" | "CF" | "TD" | "CL" | "CN" | "CO" | "KM" | "CK" | "CR" | "HR" | "CW" | "CY" | "CZ" | "CD" | "DK" | "DJ" | "DM" | "DO" | "TL" | "EC" | "EG" | "SV" | "GQ" | "ER" | "EE" | "ET" | "FO" | "FJ" | "FI" | "FR" | "GF" | "PF" | "GA" | "GM" | "GE" | "DE" | "GH" | "GR" | "GD" | "GP" | "GU" | "GT" | "GN" | "GW" | "GY" | "HT" | "HK" | "HN" | "HU" | "IS" | "IN" | "ID" | "IR" | "IQ" | "IE" | "IM" | "IL" | "IT" | "CI" | "JM" | "JP" | "JE" | "JO" | "KZ" | "KE" | "KI" | "XK" | "KW" | "KG" | "LA" | "LV" | "LB" | "LS" | "LR" | "LI" | "LT" | "LU" | "MK" | "MG" | "MW" | "MY" | "MV" | "ML" | "MT" | "MQ" | "MR" | "MU" | "MX" | "FM" | "MD" | "MC" | "MN" | "ME" | "MS" | "MA" | "MZ" | "NA" | "NP" | "NL" | "NZ" | "NI" | "NE" | "NG" | "NU" | "NF" | "KP" | "NO" | "OM" | "PK" | "PS" | "PA" | "PG" | "PY" | "PE" | "PH" | "PL" | "PT" | "PR" | "QA" | "CG" | "RE" | "RO" | "RU" | "RW" | "BL" | "KN" | "LC" | "MF" | "VC" | "WS" | "SM" | "SA" | "SN" | "RS" | "SC" | "SL" | "SG" | "SX" | "SK" | "SI" | "SO" | "ZA" | "KR" | "SS" | "ES" | "LK" | "SD" | "SR" | "SJ" | "SZ" | "SE" | "CH" | "TW" | "TJ" | "TZ" | "TH" | "TG" | "TO" | "TT" | "TN" | "TR" | "TM" | "UM" | "VI" | "UG" | "UA" | "AE" | "GB" | "US" | "UZ" | "VU" | "VE" | "VN" | "WF" | "EH" | "YE" | "ZM" | "ZW")[]]>>;
|
|
837
838
|
routingNumber: drizzle_orm_sqlite_core.SQLiteTextBuilder<[string, ...string[]]>;
|
|
838
839
|
sortCode: drizzle_orm_sqlite_core.SQLiteTextBuilder<[string, ...string[]]>;
|
|
839
840
|
clabe: drizzle_orm_sqlite_core.SQLiteTextBuilder<[string, ...string[]]>;
|
|
@@ -1020,6 +1021,7 @@ interface InternalError {
|
|
|
1020
1021
|
status: InternalErrorResponseStatus;
|
|
1021
1022
|
code: string;
|
|
1022
1023
|
message: string;
|
|
1024
|
+
cause?: Error;
|
|
1023
1025
|
}
|
|
1024
1026
|
interface IRPCResponse<T> {
|
|
1025
1027
|
status: ContentfulStatusCode;
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export { ContentfulStatusCode as InternalResponseStatus } from 'hono/utils/http-
|
|
|
9
9
|
import { Queue, MessageBatch } from '@cloudflare/workers-types';
|
|
10
10
|
import { BatchItem } from 'drizzle-orm/batch';
|
|
11
11
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
12
|
+
export { E as ErrorReportContext, a as ErrorReporter, r as reportError, s as setErrorReporter } from './shared/backend-sdk.D6_sG5co.js';
|
|
12
13
|
|
|
13
14
|
declare const ENVIRONMENT: string[];
|
|
14
15
|
|
|
@@ -40,7 +41,6 @@ declare const structuredAddressSchema: z$1.ZodObject<{
|
|
|
40
41
|
city: z$1.ZodOptional<z$1.ZodString>;
|
|
41
42
|
postalCode: z$1.ZodOptional<z$1.ZodString>;
|
|
42
43
|
countryCode: z$1.ZodOptional<z$1.ZodEnum<{
|
|
43
|
-
IM: "IM";
|
|
44
44
|
AF: "AF";
|
|
45
45
|
AL: "AL";
|
|
46
46
|
DZ: "DZ";
|
|
@@ -130,6 +130,7 @@ declare const structuredAddressSchema: z$1.ZodObject<{
|
|
|
130
130
|
IR: "IR";
|
|
131
131
|
IQ: "IQ";
|
|
132
132
|
IE: "IE";
|
|
133
|
+
IM: "IM";
|
|
133
134
|
IL: "IL";
|
|
134
135
|
IT: "IT";
|
|
135
136
|
CI: "CI";
|
|
@@ -330,7 +331,6 @@ declare const bankAccountMetadataSchema: z$1.ZodObject<{
|
|
|
330
331
|
city: z$1.ZodOptional<z$1.ZodString>;
|
|
331
332
|
postalCode: z$1.ZodOptional<z$1.ZodString>;
|
|
332
333
|
countryCode: z$1.ZodOptional<z$1.ZodEnum<{
|
|
333
|
-
IM: "IM";
|
|
334
334
|
AF: "AF";
|
|
335
335
|
AL: "AL";
|
|
336
336
|
DZ: "DZ";
|
|
@@ -420,6 +420,7 @@ declare const bankAccountMetadataSchema: z$1.ZodObject<{
|
|
|
420
420
|
IR: "IR";
|
|
421
421
|
IQ: "IQ";
|
|
422
422
|
IE: "IE";
|
|
423
|
+
IM: "IM";
|
|
423
424
|
IL: "IL";
|
|
424
425
|
IT: "IT";
|
|
425
426
|
CI: "CI";
|
|
@@ -602,7 +603,6 @@ declare const bankAccountMetadataSchema: z$1.ZodObject<{
|
|
|
602
603
|
AVAX: "AVAX";
|
|
603
604
|
}>>;
|
|
604
605
|
countryCode: z$1.ZodOptional<z$1.ZodEnum<{
|
|
605
|
-
IM: "IM";
|
|
606
606
|
AF: "AF";
|
|
607
607
|
AL: "AL";
|
|
608
608
|
DZ: "DZ";
|
|
@@ -692,6 +692,7 @@ declare const bankAccountMetadataSchema: z$1.ZodObject<{
|
|
|
692
692
|
IR: "IR";
|
|
693
693
|
IQ: "IQ";
|
|
694
694
|
IE: "IE";
|
|
695
|
+
IM: "IM";
|
|
695
696
|
IL: "IL";
|
|
696
697
|
IT: "IT";
|
|
697
698
|
CI: "CI";
|
|
@@ -833,7 +834,7 @@ declare const bankAccount: {
|
|
|
833
834
|
swiftBic: drizzle_orm_sqlite_core.SQLiteTextBuilder<[string, ...string[]]>;
|
|
834
835
|
bicCor: drizzle_orm_sqlite_core.SQLiteTextBuilder<[string, ...string[]]>;
|
|
835
836
|
currency: drizzle_orm.NotNull<drizzle_orm_sqlite_core.SQLiteTextBuilder<["CZK" | "EUR" | "USD" | "PLN" | "RON" | "GBP" | "RUB" | "HUF" | "CHF" | "DKK" | "SEK" | "HRK" | "NOK" | "BGN" | "TRY" | "AUD" | "CAD" | "JPY" | "CNY" | "INR" | "BRL" | "MXN" | "ZAR" | "SGD" | "HKD" | "KRW" | "MYR" | "THB" | "IDR" | "PHP" | "AED" | "SAR" | "ILS" | "EGP" | "NGN" | "PKR" | "COP" | "CLP" | "PEN" | "VND" | "KZT" | "UAH" | "BTC" | "ETH" | "ADA" | "DOT" | "ATOM" | "XRP" | "LTC" | "SOL" | "DOGE" | "MATIC" | "AVAX", ...("CZK" | "EUR" | "USD" | "PLN" | "RON" | "GBP" | "RUB" | "HUF" | "CHF" | "DKK" | "SEK" | "HRK" | "NOK" | "BGN" | "TRY" | "AUD" | "CAD" | "JPY" | "CNY" | "INR" | "BRL" | "MXN" | "ZAR" | "SGD" | "HKD" | "KRW" | "MYR" | "THB" | "IDR" | "PHP" | "AED" | "SAR" | "ILS" | "EGP" | "NGN" | "PKR" | "COP" | "CLP" | "PEN" | "VND" | "KZT" | "UAH" | "BTC" | "ETH" | "ADA" | "DOT" | "ATOM" | "XRP" | "LTC" | "SOL" | "DOGE" | "MATIC" | "AVAX")[]]>>;
|
|
836
|
-
countryCode: drizzle_orm.NotNull<drizzle_orm_sqlite_core.SQLiteTextBuilder<["
|
|
837
|
+
countryCode: drizzle_orm.NotNull<drizzle_orm_sqlite_core.SQLiteTextBuilder<["AF" | "AL" | "DZ" | "AS" | "AD" | "AO" | "AG" | "AR" | "AM" | "AW" | "AU" | "AT" | "AZ" | "BS" | "BH" | "BD" | "BB" | "BY" | "BE" | "BZ" | "BJ" | "BO" | "BQ" | "BA" | "BW" | "BR" | "IO" | "VG" | "BG" | "BF" | "BI" | "KH" | "CM" | "CA" | "CV" | "CF" | "TD" | "CL" | "CN" | "CO" | "KM" | "CK" | "CR" | "HR" | "CW" | "CY" | "CZ" | "CD" | "DK" | "DJ" | "DM" | "DO" | "TL" | "EC" | "EG" | "SV" | "GQ" | "ER" | "EE" | "ET" | "FO" | "FJ" | "FI" | "FR" | "GF" | "PF" | "GA" | "GM" | "GE" | "DE" | "GH" | "GR" | "GD" | "GP" | "GU" | "GT" | "GN" | "GW" | "GY" | "HT" | "HK" | "HN" | "HU" | "IS" | "IN" | "ID" | "IR" | "IQ" | "IE" | "IM" | "IL" | "IT" | "CI" | "JM" | "JP" | "JE" | "JO" | "KZ" | "KE" | "KI" | "XK" | "KW" | "KG" | "LA" | "LV" | "LB" | "LS" | "LR" | "LI" | "LT" | "LU" | "MK" | "MG" | "MW" | "MY" | "MV" | "ML" | "MT" | "MQ" | "MR" | "MU" | "MX" | "FM" | "MD" | "MC" | "MN" | "ME" | "MS" | "MA" | "MZ" | "NA" | "NP" | "NL" | "NZ" | "NI" | "NE" | "NG" | "NU" | "NF" | "KP" | "NO" | "OM" | "PK" | "PS" | "PA" | "PG" | "PY" | "PE" | "PH" | "PL" | "PT" | "PR" | "QA" | "CG" | "RE" | "RO" | "RU" | "RW" | "BL" | "KN" | "LC" | "MF" | "VC" | "WS" | "SM" | "SA" | "SN" | "RS" | "SC" | "SL" | "SG" | "SX" | "SK" | "SI" | "SO" | "ZA" | "KR" | "SS" | "ES" | "LK" | "SD" | "SR" | "SJ" | "SZ" | "SE" | "CH" | "TW" | "TJ" | "TZ" | "TH" | "TG" | "TO" | "TT" | "TN" | "TR" | "TM" | "UM" | "VI" | "UG" | "UA" | "AE" | "GB" | "US" | "UZ" | "VU" | "VE" | "VN" | "WF" | "EH" | "YE" | "ZM" | "ZW", ...("AF" | "AL" | "DZ" | "AS" | "AD" | "AO" | "AG" | "AR" | "AM" | "AW" | "AU" | "AT" | "AZ" | "BS" | "BH" | "BD" | "BB" | "BY" | "BE" | "BZ" | "BJ" | "BO" | "BQ" | "BA" | "BW" | "BR" | "IO" | "VG" | "BG" | "BF" | "BI" | "KH" | "CM" | "CA" | "CV" | "CF" | "TD" | "CL" | "CN" | "CO" | "KM" | "CK" | "CR" | "HR" | "CW" | "CY" | "CZ" | "CD" | "DK" | "DJ" | "DM" | "DO" | "TL" | "EC" | "EG" | "SV" | "GQ" | "ER" | "EE" | "ET" | "FO" | "FJ" | "FI" | "FR" | "GF" | "PF" | "GA" | "GM" | "GE" | "DE" | "GH" | "GR" | "GD" | "GP" | "GU" | "GT" | "GN" | "GW" | "GY" | "HT" | "HK" | "HN" | "HU" | "IS" | "IN" | "ID" | "IR" | "IQ" | "IE" | "IM" | "IL" | "IT" | "CI" | "JM" | "JP" | "JE" | "JO" | "KZ" | "KE" | "KI" | "XK" | "KW" | "KG" | "LA" | "LV" | "LB" | "LS" | "LR" | "LI" | "LT" | "LU" | "MK" | "MG" | "MW" | "MY" | "MV" | "ML" | "MT" | "MQ" | "MR" | "MU" | "MX" | "FM" | "MD" | "MC" | "MN" | "ME" | "MS" | "MA" | "MZ" | "NA" | "NP" | "NL" | "NZ" | "NI" | "NE" | "NG" | "NU" | "NF" | "KP" | "NO" | "OM" | "PK" | "PS" | "PA" | "PG" | "PY" | "PE" | "PH" | "PL" | "PT" | "PR" | "QA" | "CG" | "RE" | "RO" | "RU" | "RW" | "BL" | "KN" | "LC" | "MF" | "VC" | "WS" | "SM" | "SA" | "SN" | "RS" | "SC" | "SL" | "SG" | "SX" | "SK" | "SI" | "SO" | "ZA" | "KR" | "SS" | "ES" | "LK" | "SD" | "SR" | "SJ" | "SZ" | "SE" | "CH" | "TW" | "TJ" | "TZ" | "TH" | "TG" | "TO" | "TT" | "TN" | "TR" | "TM" | "UM" | "VI" | "UG" | "UA" | "AE" | "GB" | "US" | "UZ" | "VU" | "VE" | "VN" | "WF" | "EH" | "YE" | "ZM" | "ZW")[]]>>;
|
|
837
838
|
routingNumber: drizzle_orm_sqlite_core.SQLiteTextBuilder<[string, ...string[]]>;
|
|
838
839
|
sortCode: drizzle_orm_sqlite_core.SQLiteTextBuilder<[string, ...string[]]>;
|
|
839
840
|
clabe: drizzle_orm_sqlite_core.SQLiteTextBuilder<[string, ...string[]]>;
|
|
@@ -1020,6 +1021,7 @@ interface InternalError {
|
|
|
1020
1021
|
status: InternalErrorResponseStatus;
|
|
1021
1022
|
code: string;
|
|
1022
1023
|
message: string;
|
|
1024
|
+
cause?: Error;
|
|
1023
1025
|
}
|
|
1024
1026
|
interface IRPCResponse<T> {
|
|
1025
1027
|
status: ContentfulStatusCode;
|
package/dist/index.mjs
CHANGED
|
@@ -6,6 +6,8 @@ import { COUNTRY_CODES_2, CURRENCY_CODES, BANK_CODES } from '@develit-io/general
|
|
|
6
6
|
import { createInsertSchema as createInsertSchema$1, createSelectSchema as createSelectSchema$1 } from 'drizzle-orm/zod';
|
|
7
7
|
import { z as z$1 } from 'zod';
|
|
8
8
|
import * as z from 'zod/v4/core';
|
|
9
|
+
import { i as isInternalError, c as createInternalError, t as toErrorStatus, r as reportError } from './shared/backend-sdk.e9CWR7-E.mjs';
|
|
10
|
+
export { s as setErrorReporter } from './shared/backend-sdk.e9CWR7-E.mjs';
|
|
9
11
|
import Cloudflare from 'cloudflare';
|
|
10
12
|
import { parse } from 'comment-json';
|
|
11
13
|
import crypto$1 from 'node:crypto';
|
|
@@ -283,23 +285,6 @@ const paginationSchema = new z.$ZodObject({
|
|
|
283
285
|
}
|
|
284
286
|
});
|
|
285
287
|
|
|
286
|
-
const createInternalError = (error, details) => {
|
|
287
|
-
return {
|
|
288
|
-
status: details?.status || 500,
|
|
289
|
-
code: details?.code || "UNKNOWN_ERROR",
|
|
290
|
-
message: details?.message || (error instanceof Error ? error.message : "An unexpected error occurred.")
|
|
291
|
-
};
|
|
292
|
-
};
|
|
293
|
-
const isInternalError = (error) => {
|
|
294
|
-
return typeof error === "object" && error !== null && "message" in error && "code" in error;
|
|
295
|
-
};
|
|
296
|
-
const toErrorStatus = (status) => {
|
|
297
|
-
if (status >= 400 && status < 600) {
|
|
298
|
-
return status;
|
|
299
|
-
}
|
|
300
|
-
return 500;
|
|
301
|
-
};
|
|
302
|
-
|
|
303
288
|
const REDACTED = "[REDACTED]";
|
|
304
289
|
const DEFAULT_SENSITIVE_KEYS = [
|
|
305
290
|
"password",
|
|
@@ -980,6 +965,12 @@ function cloudflareQueue(options) {
|
|
|
980
965
|
};
|
|
981
966
|
}
|
|
982
967
|
|
|
968
|
+
const composeLogEntry = (worker, identifier, data) => ({
|
|
969
|
+
entrypoint: worker.name,
|
|
970
|
+
action: worker.action,
|
|
971
|
+
identifier,
|
|
972
|
+
data: serializeLog(data)
|
|
973
|
+
});
|
|
983
974
|
function develitWorker(Worker) {
|
|
984
975
|
class DevelitWorker extends Worker {
|
|
985
976
|
name = "not-set";
|
|
@@ -1002,7 +993,9 @@ function develitWorker(Worker) {
|
|
|
1002
993
|
throw RPCResponse.validationError(parseError);
|
|
1003
994
|
}
|
|
1004
995
|
if (!parseResult.data) {
|
|
1005
|
-
throw createInternalError({
|
|
996
|
+
throw createInternalError(null, {
|
|
997
|
+
status: 400,
|
|
998
|
+
code: "DEFORMED_ACTION_INPUT",
|
|
1006
999
|
message: "The provided input could not be processed."
|
|
1007
1000
|
});
|
|
1008
1001
|
}
|
|
@@ -1010,12 +1003,7 @@ function develitWorker(Worker) {
|
|
|
1010
1003
|
}
|
|
1011
1004
|
log(data, identifier) {
|
|
1012
1005
|
const name = identifier ?? `${this.name}:${this.action}:log`;
|
|
1013
|
-
console.log(name,
|
|
1014
|
-
entrypoint: this.name,
|
|
1015
|
-
action: this.action,
|
|
1016
|
-
identifier: name,
|
|
1017
|
-
data: serializeLog(data)
|
|
1018
|
-
});
|
|
1006
|
+
console.log(name, composeLogEntry(this, name, data));
|
|
1019
1007
|
}
|
|
1020
1008
|
transformLogData(data) {
|
|
1021
1009
|
return data;
|
|
@@ -1048,10 +1036,12 @@ function develitWorker(Worker) {
|
|
|
1048
1036
|
);
|
|
1049
1037
|
}
|
|
1050
1038
|
logError(error) {
|
|
1051
|
-
this.
|
|
1052
|
-
|
|
1053
|
-
|
|
1039
|
+
const name = `${this.name}:${this.action}:error`;
|
|
1040
|
+
console.error(
|
|
1041
|
+
name,
|
|
1042
|
+
composeLogEntry(this, name, this.transformLogData(error))
|
|
1054
1043
|
);
|
|
1044
|
+
reportError(error, { service: this.name, action: this.action });
|
|
1055
1045
|
}
|
|
1056
1046
|
async pushToQueue(queue, message) {
|
|
1057
1047
|
return pushToQueue(queue, message);
|
|
@@ -1070,4 +1060,4 @@ function develitWorker(Worker) {
|
|
|
1070
1060
|
return DevelitWorker;
|
|
1071
1061
|
}
|
|
1072
1062
|
|
|
1073
|
-
export { DLQ_ALERT_DEFAULT_MAX_INTERVAL, DLQ_ALERT_DEFAULT_MIN_SIZE, DatabaseTransaction, ENVIRONMENT, RPCResponse, USER_ROLES, action, asNonEmpty, bankAccount, bankAccountMetadataSchema, base, bicSchema, buildDlqAlert, buildMultiFilterConditions, buildRangeFilterConditions, buildSearchConditions, calculateExponentialBackoff, chunkQueueMessages, cloudflareQueue, composeWranglerBase, createAuditLogWriter, createInsertSchema, createInternalError, createPatchSchema, createSelectSchema, createUpdateSchema, defineCommand, derivePortFromId, develitWorker, durableObjectNamespaceIdFromName, first, firstOrError, getD1Credentials, getDrizzleD1Config, getLocalD1DatabaseIdFromWrangler, getSecret, handleAction, handleDlqBatch, ibanSchema, isDlqQueue, isInternalError, nullToOptional, optionalToNull, paginationQuerySchema, paginationSchema, parseDlqAlertRecipients, pushToQueue, queryInChunks, redact, resolveColumn, service, shouldAlertDlq, structuredAddressSchema, useFetch, useResult, useResultSync, workflowInstanceStatusSchema };
|
|
1063
|
+
export { DLQ_ALERT_DEFAULT_MAX_INTERVAL, DLQ_ALERT_DEFAULT_MIN_SIZE, DatabaseTransaction, ENVIRONMENT, RPCResponse, USER_ROLES, action, asNonEmpty, bankAccount, bankAccountMetadataSchema, base, bicSchema, buildDlqAlert, buildMultiFilterConditions, buildRangeFilterConditions, buildSearchConditions, calculateExponentialBackoff, chunkQueueMessages, cloudflareQueue, composeWranglerBase, createAuditLogWriter, createInsertSchema, createInternalError, createPatchSchema, createSelectSchema, createUpdateSchema, defineCommand, derivePortFromId, develitWorker, durableObjectNamespaceIdFromName, first, firstOrError, getD1Credentials, getDrizzleD1Config, getLocalD1DatabaseIdFromWrangler, getSecret, handleAction, handleDlqBatch, ibanSchema, isDlqQueue, isInternalError, nullToOptional, optionalToNull, paginationQuerySchema, paginationSchema, parseDlqAlertRecipients, pushToQueue, queryInChunks, redact, reportError, resolveColumn, service, shouldAlertDlq, structuredAddressSchema, useFetch, useResult, useResultSync, workflowInstanceStatusSchema };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as Sentry from '@sentry/cloudflare';
|
|
2
|
+
import { CloudflareOptions } from '@sentry/cloudflare';
|
|
3
|
+
import { a as ErrorReporter } from './shared/backend-sdk.D6_sG5co.mjs';
|
|
4
|
+
|
|
5
|
+
type ServiceEntrypoint = Parameters<typeof Sentry.withSentry>[1];
|
|
6
|
+
type DurableObjectClass = Parameters<typeof Sentry.instrumentDurableObjectWithSentry>[1];
|
|
7
|
+
type WorkflowClass = Parameters<typeof Sentry.instrumentWorkflowWithSentry>[1];
|
|
8
|
+
declare const instrumentService: <T extends ServiceEntrypoint>(Service: T) => T;
|
|
9
|
+
declare const instrumentDurableObject: <T extends DurableObjectClass>(DurableObject: T) => T;
|
|
10
|
+
declare const instrumentWorkflow: <T extends WorkflowClass>(Workflow: T) => T;
|
|
11
|
+
|
|
12
|
+
type SentryEnv = {
|
|
13
|
+
ENVIRONMENT?: string;
|
|
14
|
+
SENTRY_DSN?: string;
|
|
15
|
+
CF_VERSION_METADATA?: {
|
|
16
|
+
id: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
declare const sentryOptions: (env: SentryEnv) => CloudflareOptions;
|
|
20
|
+
|
|
21
|
+
declare const reportServiceErrorToSentry: ErrorReporter;
|
|
22
|
+
|
|
23
|
+
export { instrumentDurableObject, instrumentService, instrumentWorkflow, reportServiceErrorToSentry, sentryOptions };
|
package/dist/sentry.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as Sentry from '@sentry/cloudflare';
|
|
2
|
+
import { CloudflareOptions } from '@sentry/cloudflare';
|
|
3
|
+
import { a as ErrorReporter } from './shared/backend-sdk.D6_sG5co.js';
|
|
4
|
+
|
|
5
|
+
type ServiceEntrypoint = Parameters<typeof Sentry.withSentry>[1];
|
|
6
|
+
type DurableObjectClass = Parameters<typeof Sentry.instrumentDurableObjectWithSentry>[1];
|
|
7
|
+
type WorkflowClass = Parameters<typeof Sentry.instrumentWorkflowWithSentry>[1];
|
|
8
|
+
declare const instrumentService: <T extends ServiceEntrypoint>(Service: T) => T;
|
|
9
|
+
declare const instrumentDurableObject: <T extends DurableObjectClass>(DurableObject: T) => T;
|
|
10
|
+
declare const instrumentWorkflow: <T extends WorkflowClass>(Workflow: T) => T;
|
|
11
|
+
|
|
12
|
+
type SentryEnv = {
|
|
13
|
+
ENVIRONMENT?: string;
|
|
14
|
+
SENTRY_DSN?: string;
|
|
15
|
+
CF_VERSION_METADATA?: {
|
|
16
|
+
id: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
declare const sentryOptions: (env: SentryEnv) => CloudflareOptions;
|
|
20
|
+
|
|
21
|
+
declare const reportServiceErrorToSentry: ErrorReporter;
|
|
22
|
+
|
|
23
|
+
export { instrumentDurableObject, instrumentService, instrumentWorkflow, reportServiceErrorToSentry, sentryOptions };
|
package/dist/sentry.mjs
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as Sentry from '@sentry/cloudflare';
|
|
2
|
+
import { i as isInternalError, U as UNKNOWN_ERROR_CODE, s as setErrorReporter } from './shared/backend-sdk.e9CWR7-E.mjs';
|
|
3
|
+
|
|
4
|
+
const sentryOptions = (env) => ({
|
|
5
|
+
dsn: env.SENTRY_DSN,
|
|
6
|
+
environment: env.ENVIRONMENT,
|
|
7
|
+
release: env.CF_VERSION_METADATA?.id,
|
|
8
|
+
enabled: Boolean(env.SENTRY_DSN),
|
|
9
|
+
tracesSampleRate: env.ENVIRONMENT === "production" ? 0.1 : 0.2,
|
|
10
|
+
dataCollection: {
|
|
11
|
+
userInfo: false,
|
|
12
|
+
cookies: false,
|
|
13
|
+
httpHeaders: { request: { allow: ["user-agent"] }, response: false },
|
|
14
|
+
httpBodies: [],
|
|
15
|
+
urlQueryParams: false
|
|
16
|
+
},
|
|
17
|
+
integrations: (defaults) => defaults.filter(({ name }) => name !== "Console")
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const reportServiceErrorToSentry = (error, { service, action }) => {
|
|
21
|
+
const status = isInternalError(error) ? error.status : 500;
|
|
22
|
+
if (status < 500) return;
|
|
23
|
+
const logged = error;
|
|
24
|
+
const code = logged.code ?? UNKNOWN_ERROR_CODE;
|
|
25
|
+
const message = logged.message ?? `${service}:${action} failed`;
|
|
26
|
+
const thrown = error instanceof Error ? error : logged.cause instanceof Error ? logged.cause : void 0;
|
|
27
|
+
Sentry.captureException(thrown ?? new Error(message), {
|
|
28
|
+
tags: {
|
|
29
|
+
service,
|
|
30
|
+
action,
|
|
31
|
+
error_code: code,
|
|
32
|
+
error_status: String(status)
|
|
33
|
+
},
|
|
34
|
+
extra: { code, message, status },
|
|
35
|
+
fingerprint: thrown ? void 0 : ["service-error", service, action, code]
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const instrumentService = (Service) => {
|
|
40
|
+
setErrorReporter(reportServiceErrorToSentry);
|
|
41
|
+
return Sentry.withSentry(sentryOptions, Service);
|
|
42
|
+
};
|
|
43
|
+
const instrumentDurableObject = (DurableObject) => {
|
|
44
|
+
setErrorReporter(reportServiceErrorToSentry);
|
|
45
|
+
return Sentry.instrumentDurableObjectWithSentry(sentryOptions, DurableObject);
|
|
46
|
+
};
|
|
47
|
+
const instrumentWorkflow = (Workflow) => Sentry.instrumentWorkflowWithSentry(sentryOptions, Workflow);
|
|
48
|
+
|
|
49
|
+
export { instrumentDurableObject, instrumentService, instrumentWorkflow, reportServiceErrorToSentry, sentryOptions };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type ErrorReportContext = {
|
|
2
|
+
service: string;
|
|
3
|
+
action: string;
|
|
4
|
+
};
|
|
5
|
+
type ErrorReporter = (error: object, context: ErrorReportContext) => void;
|
|
6
|
+
declare const setErrorReporter: (reporter: ErrorReporter | undefined) => void;
|
|
7
|
+
declare const reportError: (error: object, context: ErrorReportContext) => void;
|
|
8
|
+
|
|
9
|
+
export { reportError as r, setErrorReporter as s };
|
|
10
|
+
export type { ErrorReportContext as E, ErrorReporter as a };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type ErrorReportContext = {
|
|
2
|
+
service: string;
|
|
3
|
+
action: string;
|
|
4
|
+
};
|
|
5
|
+
type ErrorReporter = (error: object, context: ErrorReportContext) => void;
|
|
6
|
+
declare const setErrorReporter: (reporter: ErrorReporter | undefined) => void;
|
|
7
|
+
declare const reportError: (error: object, context: ErrorReportContext) => void;
|
|
8
|
+
|
|
9
|
+
export { reportError as r, setErrorReporter as s };
|
|
10
|
+
export type { ErrorReportContext as E, ErrorReporter as a };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const UNKNOWN_ERROR_CODE = "UNKNOWN_ERROR";
|
|
2
|
+
const createInternalError = (error, details) => {
|
|
3
|
+
const internalError = {
|
|
4
|
+
status: details?.status || 500,
|
|
5
|
+
code: details?.code || UNKNOWN_ERROR_CODE,
|
|
6
|
+
message: details?.message || (error instanceof Error ? error.message : "An unexpected error occurred.")
|
|
7
|
+
};
|
|
8
|
+
if (error instanceof Error) {
|
|
9
|
+
Object.defineProperty(internalError, "cause", {
|
|
10
|
+
value: error,
|
|
11
|
+
enumerable: false
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
return internalError;
|
|
15
|
+
};
|
|
16
|
+
const isInternalError = (error) => {
|
|
17
|
+
return typeof error === "object" && error !== null && "message" in error && "code" in error;
|
|
18
|
+
};
|
|
19
|
+
const toErrorStatus = (status) => {
|
|
20
|
+
if (status >= 400 && status < 600) {
|
|
21
|
+
return status;
|
|
22
|
+
}
|
|
23
|
+
return 500;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
let errorReporter;
|
|
27
|
+
const setErrorReporter = (reporter) => {
|
|
28
|
+
errorReporter = reporter;
|
|
29
|
+
};
|
|
30
|
+
const reportError = (error, context) => {
|
|
31
|
+
if (!errorReporter) return;
|
|
32
|
+
try {
|
|
33
|
+
errorReporter(error, context);
|
|
34
|
+
} catch (reporterError) {
|
|
35
|
+
console.error("Error reporter failed", reporterError);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export { UNKNOWN_ERROR_CODE as U, createInternalError as c, isInternalError as i, reportError as r, setErrorReporter as s, toErrorStatus as t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@develit-io/backend-sdk",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.7.0",
|
|
4
4
|
"description": "Develit Backend SDK",
|
|
5
5
|
"author": "Develit.io",
|
|
6
6
|
"license": "ISC",
|
|
@@ -32,6 +32,11 @@
|
|
|
32
32
|
"import": "./dist/utils/signature.util.mjs",
|
|
33
33
|
"default": "./dist/utils/signature.util.mjs"
|
|
34
34
|
},
|
|
35
|
+
"./sentry": {
|
|
36
|
+
"types": "./dist/sentry.d.ts",
|
|
37
|
+
"import": "./dist/sentry.mjs",
|
|
38
|
+
"default": "./dist/sentry.mjs"
|
|
39
|
+
},
|
|
35
40
|
"./package.json": "./package.json"
|
|
36
41
|
},
|
|
37
42
|
"files": [
|
|
@@ -39,18 +44,25 @@
|
|
|
39
44
|
],
|
|
40
45
|
"dependencies": {
|
|
41
46
|
"@cloudflare/workers-types": "^4.20260217.0 || ^5.0.0",
|
|
42
|
-
"cloudflare": "^
|
|
47
|
+
"cloudflare": "^7.1.0",
|
|
43
48
|
"comment-json": "^4.5.1",
|
|
44
49
|
"superjson": "^2.2.5"
|
|
45
50
|
},
|
|
46
51
|
"peerDependencies": {
|
|
47
52
|
"@develit-io/general-codes": "^1.19.2",
|
|
48
|
-
"drizzle-orm": "1.0.0-rc.1",
|
|
53
|
+
"drizzle-orm": "^1.0.0-rc.1",
|
|
54
|
+
"@sentry/cloudflare": "^11.9.0",
|
|
49
55
|
"hono": "^4.12.7",
|
|
50
56
|
"zod": "^4.3.6"
|
|
51
57
|
},
|
|
58
|
+
"peerDependenciesMeta": {
|
|
59
|
+
"@sentry/cloudflare": {
|
|
60
|
+
"optional": true
|
|
61
|
+
}
|
|
62
|
+
},
|
|
52
63
|
"devDependencies": {
|
|
53
64
|
"@packages/shared": "workspace:*",
|
|
65
|
+
"@sentry/cloudflare": "11.9.0",
|
|
54
66
|
"drizzle-orm": "1.0.0-rc.1"
|
|
55
67
|
}
|
|
56
68
|
}
|