@develit-io/backend-sdk 5.46.0 → 6.0.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 +13 -10
- package/dist/index.d.ts +13 -10
- package/dist/index.mjs +9 -4
- package/package.json +1 -2
package/dist/index.d.mts
CHANGED
|
@@ -5,8 +5,8 @@ import { AnySQLiteTable } from 'drizzle-orm/sqlite-core';
|
|
|
5
5
|
import { MiddlewareHandler } from 'hono/types';
|
|
6
6
|
import { z as z$1 } from 'zod';
|
|
7
7
|
import * as z from 'zod/v4/core';
|
|
8
|
-
import {
|
|
9
|
-
export {
|
|
8
|
+
import { ContentfulStatusCode, SuccessStatusCode } from 'hono/utils/http-status';
|
|
9
|
+
export { ContentfulStatusCode as InternalResponseStatus } from 'hono/utils/http-status';
|
|
10
10
|
import { Queue } from '@cloudflare/workers-types';
|
|
11
11
|
import { BatchItem } from 'drizzle-orm/batch';
|
|
12
12
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
@@ -15,7 +15,7 @@ declare const uuidv4: () => `${string}-${string}-${string}-${string}-${string}`;
|
|
|
15
15
|
|
|
16
16
|
type Environment = string | 'localhost' | 'dev' | 'test' | 'staging' | 'production';
|
|
17
17
|
|
|
18
|
-
type Project = 'creditio' | 'dbu-mdm' | 'dbu-txs' | 'lrf-website' | 'moneio' | 'paycorp-fiat-processor';
|
|
18
|
+
type Project = 'creditio' | 'dbu-mdm' | 'dbu-txs' | 'cryptobyte-website' | 'lrf-website' | 'moneio' | 'paycorp-fiat-processor';
|
|
19
19
|
|
|
20
20
|
declare const base: {
|
|
21
21
|
id: drizzle_orm.IsPrimaryKey<drizzle_orm.NotNull<drizzle_orm_sqlite_core.SQLiteTextBuilderInitial<"id", [string, ...string[]], number | undefined>>>;
|
|
@@ -33,7 +33,7 @@ declare const bankAccount: {
|
|
|
33
33
|
swiftBic: drizzle_orm_sqlite_core.SQLiteTextBuilderInitial<"swift_bic", [string, ...string[]], number | undefined>;
|
|
34
34
|
bicCor: drizzle_orm_sqlite_core.SQLiteTextBuilderInitial<"bic_cor", [string, ...string[]], number | undefined>;
|
|
35
35
|
currency: drizzle_orm.NotNull<drizzle_orm_sqlite_core.SQLiteTextBuilderInitial<"currency", ["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")[]], number | undefined>>;
|
|
36
|
-
countryCode: drizzle_orm.NotNull<drizzle_orm_sqlite_core.SQLiteTextBuilderInitial<"country_code", ["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" | "
|
|
36
|
+
countryCode: drizzle_orm.NotNull<drizzle_orm_sqlite_core.SQLiteTextBuilderInitial<"country_code", ["EC" | "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" | "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" | "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" | "UZ" | "VU" | "VE" | "VN" | "WF" | "EH" | "YE" | "ZM" | "ZW", ...("EC" | "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" | "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" | "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" | "UZ" | "VU" | "VE" | "VN" | "WF" | "EH" | "YE" | "ZM" | "ZW")[]], number | undefined>>;
|
|
37
37
|
routingNumber: drizzle_orm_sqlite_core.SQLiteTextBuilderInitial<"routing_number", [string, ...string[]], number | undefined>;
|
|
38
38
|
sortCode: drizzle_orm_sqlite_core.SQLiteTextBuilderInitial<"sort_code", [string, ...string[]], number | undefined>;
|
|
39
39
|
clabe: drizzle_orm_sqlite_core.SQLiteTextBuilderInitial<"clabe", [string, ...string[]], number | undefined>;
|
|
@@ -208,6 +208,7 @@ declare const bankAccountMetadataSchema: z$1.ZodObject<{
|
|
|
208
208
|
AVAX: "AVAX";
|
|
209
209
|
}>>;
|
|
210
210
|
country: z$1.ZodOptional<z$1.ZodEnum<{
|
|
211
|
+
EC: "EC";
|
|
211
212
|
AF: "AF";
|
|
212
213
|
AL: "AL";
|
|
213
214
|
DZ: "DZ";
|
|
@@ -261,7 +262,6 @@ declare const bankAccountMetadataSchema: z$1.ZodObject<{
|
|
|
261
262
|
DM: "DM";
|
|
262
263
|
DO: "DO";
|
|
263
264
|
TL: "TL";
|
|
264
|
-
EC: "EC";
|
|
265
265
|
EG: "EG";
|
|
266
266
|
SV: "SV";
|
|
267
267
|
GQ: "GQ";
|
|
@@ -478,18 +478,17 @@ declare const paginationSchema: z.$ZodObject<Readonly<Readonly<{
|
|
|
478
478
|
[k: string]: z.$ZodType<unknown, unknown, z.$ZodTypeInternals<unknown, unknown>>;
|
|
479
479
|
}>>, z.$ZodObjectConfig>;
|
|
480
480
|
|
|
481
|
-
type InternalErrorResponseStatus = Exclude<
|
|
481
|
+
type InternalErrorResponseStatus = Exclude<ContentfulStatusCode, SuccessStatusCode>;
|
|
482
482
|
interface InternalError {
|
|
483
483
|
status: InternalErrorResponseStatus;
|
|
484
484
|
code: string;
|
|
485
485
|
message: string;
|
|
486
486
|
}
|
|
487
487
|
interface IRPCResponse<T> {
|
|
488
|
-
status:
|
|
488
|
+
status: ContentfulStatusCode;
|
|
489
489
|
message: string;
|
|
490
490
|
data: T | null | undefined;
|
|
491
491
|
error: boolean;
|
|
492
|
-
phrase?: ReasonPhrases;
|
|
493
492
|
}
|
|
494
493
|
interface GatewayResponse<T> {
|
|
495
494
|
status?: number;
|
|
@@ -515,7 +514,11 @@ interface BaseEvent {
|
|
|
515
514
|
timestamp: string;
|
|
516
515
|
correlationId: string;
|
|
517
516
|
entityId: string;
|
|
518
|
-
|
|
517
|
+
/**
|
|
518
|
+
* Idempotency key is built as
|
|
519
|
+
* `${entityId}-${eventSignal}-${idempotencySuffix}`
|
|
520
|
+
*/
|
|
521
|
+
idempotencySuffix?: string;
|
|
519
522
|
};
|
|
520
523
|
}
|
|
521
524
|
|
|
@@ -744,7 +747,7 @@ declare const RPCResponse: {
|
|
|
744
747
|
*/
|
|
745
748
|
ok<T>(message: string, detail?: {
|
|
746
749
|
data?: T;
|
|
747
|
-
status?:
|
|
750
|
+
status?: ContentfulStatusCode;
|
|
748
751
|
}): IRPCResponse<T>;
|
|
749
752
|
/**
|
|
750
753
|
* ❌ Constructs a generic service error response.
|
package/dist/index.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ import { AnySQLiteTable } from 'drizzle-orm/sqlite-core';
|
|
|
5
5
|
import { MiddlewareHandler } from 'hono/types';
|
|
6
6
|
import { z as z$1 } from 'zod';
|
|
7
7
|
import * as z from 'zod/v4/core';
|
|
8
|
-
import {
|
|
9
|
-
export {
|
|
8
|
+
import { ContentfulStatusCode, SuccessStatusCode } from 'hono/utils/http-status';
|
|
9
|
+
export { ContentfulStatusCode as InternalResponseStatus } from 'hono/utils/http-status';
|
|
10
10
|
import { Queue } from '@cloudflare/workers-types';
|
|
11
11
|
import { BatchItem } from 'drizzle-orm/batch';
|
|
12
12
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
@@ -15,7 +15,7 @@ declare const uuidv4: () => `${string}-${string}-${string}-${string}-${string}`;
|
|
|
15
15
|
|
|
16
16
|
type Environment = string | 'localhost' | 'dev' | 'test' | 'staging' | 'production';
|
|
17
17
|
|
|
18
|
-
type Project = 'creditio' | 'dbu-mdm' | 'dbu-txs' | 'lrf-website' | 'moneio' | 'paycorp-fiat-processor';
|
|
18
|
+
type Project = 'creditio' | 'dbu-mdm' | 'dbu-txs' | 'cryptobyte-website' | 'lrf-website' | 'moneio' | 'paycorp-fiat-processor';
|
|
19
19
|
|
|
20
20
|
declare const base: {
|
|
21
21
|
id: drizzle_orm.IsPrimaryKey<drizzle_orm.NotNull<drizzle_orm_sqlite_core.SQLiteTextBuilderInitial<"id", [string, ...string[]], number | undefined>>>;
|
|
@@ -33,7 +33,7 @@ declare const bankAccount: {
|
|
|
33
33
|
swiftBic: drizzle_orm_sqlite_core.SQLiteTextBuilderInitial<"swift_bic", [string, ...string[]], number | undefined>;
|
|
34
34
|
bicCor: drizzle_orm_sqlite_core.SQLiteTextBuilderInitial<"bic_cor", [string, ...string[]], number | undefined>;
|
|
35
35
|
currency: drizzle_orm.NotNull<drizzle_orm_sqlite_core.SQLiteTextBuilderInitial<"currency", ["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")[]], number | undefined>>;
|
|
36
|
-
countryCode: drizzle_orm.NotNull<drizzle_orm_sqlite_core.SQLiteTextBuilderInitial<"country_code", ["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" | "
|
|
36
|
+
countryCode: drizzle_orm.NotNull<drizzle_orm_sqlite_core.SQLiteTextBuilderInitial<"country_code", ["EC" | "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" | "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" | "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" | "UZ" | "VU" | "VE" | "VN" | "WF" | "EH" | "YE" | "ZM" | "ZW", ...("EC" | "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" | "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" | "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" | "UZ" | "VU" | "VE" | "VN" | "WF" | "EH" | "YE" | "ZM" | "ZW")[]], number | undefined>>;
|
|
37
37
|
routingNumber: drizzle_orm_sqlite_core.SQLiteTextBuilderInitial<"routing_number", [string, ...string[]], number | undefined>;
|
|
38
38
|
sortCode: drizzle_orm_sqlite_core.SQLiteTextBuilderInitial<"sort_code", [string, ...string[]], number | undefined>;
|
|
39
39
|
clabe: drizzle_orm_sqlite_core.SQLiteTextBuilderInitial<"clabe", [string, ...string[]], number | undefined>;
|
|
@@ -208,6 +208,7 @@ declare const bankAccountMetadataSchema: z$1.ZodObject<{
|
|
|
208
208
|
AVAX: "AVAX";
|
|
209
209
|
}>>;
|
|
210
210
|
country: z$1.ZodOptional<z$1.ZodEnum<{
|
|
211
|
+
EC: "EC";
|
|
211
212
|
AF: "AF";
|
|
212
213
|
AL: "AL";
|
|
213
214
|
DZ: "DZ";
|
|
@@ -261,7 +262,6 @@ declare const bankAccountMetadataSchema: z$1.ZodObject<{
|
|
|
261
262
|
DM: "DM";
|
|
262
263
|
DO: "DO";
|
|
263
264
|
TL: "TL";
|
|
264
|
-
EC: "EC";
|
|
265
265
|
EG: "EG";
|
|
266
266
|
SV: "SV";
|
|
267
267
|
GQ: "GQ";
|
|
@@ -478,18 +478,17 @@ declare const paginationSchema: z.$ZodObject<Readonly<Readonly<{
|
|
|
478
478
|
[k: string]: z.$ZodType<unknown, unknown, z.$ZodTypeInternals<unknown, unknown>>;
|
|
479
479
|
}>>, z.$ZodObjectConfig>;
|
|
480
480
|
|
|
481
|
-
type InternalErrorResponseStatus = Exclude<
|
|
481
|
+
type InternalErrorResponseStatus = Exclude<ContentfulStatusCode, SuccessStatusCode>;
|
|
482
482
|
interface InternalError {
|
|
483
483
|
status: InternalErrorResponseStatus;
|
|
484
484
|
code: string;
|
|
485
485
|
message: string;
|
|
486
486
|
}
|
|
487
487
|
interface IRPCResponse<T> {
|
|
488
|
-
status:
|
|
488
|
+
status: ContentfulStatusCode;
|
|
489
489
|
message: string;
|
|
490
490
|
data: T | null | undefined;
|
|
491
491
|
error: boolean;
|
|
492
|
-
phrase?: ReasonPhrases;
|
|
493
492
|
}
|
|
494
493
|
interface GatewayResponse<T> {
|
|
495
494
|
status?: number;
|
|
@@ -515,7 +514,11 @@ interface BaseEvent {
|
|
|
515
514
|
timestamp: string;
|
|
516
515
|
correlationId: string;
|
|
517
516
|
entityId: string;
|
|
518
|
-
|
|
517
|
+
/**
|
|
518
|
+
* Idempotency key is built as
|
|
519
|
+
* `${entityId}-${eventSignal}-${idempotencySuffix}`
|
|
520
|
+
*/
|
|
521
|
+
idempotencySuffix?: string;
|
|
519
522
|
};
|
|
520
523
|
}
|
|
521
524
|
|
|
@@ -744,7 +747,7 @@ declare const RPCResponse: {
|
|
|
744
747
|
*/
|
|
745
748
|
ok<T>(message: string, detail?: {
|
|
746
749
|
data?: T;
|
|
747
|
-
status?:
|
|
750
|
+
status?: ContentfulStatusCode;
|
|
748
751
|
}): IRPCResponse<T>;
|
|
749
752
|
/**
|
|
750
753
|
* ❌ Constructs a generic service error response.
|
package/dist/index.mjs
CHANGED
|
@@ -11,7 +11,6 @@ import crypto$1 from 'node:crypto';
|
|
|
11
11
|
import path from 'node:path';
|
|
12
12
|
import { parse } from 'comment-json';
|
|
13
13
|
import * as z from 'zod/v4/core';
|
|
14
|
-
import 'http-status-codes';
|
|
15
14
|
import superjson from 'superjson';
|
|
16
15
|
|
|
17
16
|
const uuidv4 = () => crypto.randomUUID();
|
|
@@ -134,6 +133,12 @@ const createInternalError = (error, details) => {
|
|
|
134
133
|
const isInternalError = (error) => {
|
|
135
134
|
return typeof error === "object" && error !== null && "message" in error && "code" in error;
|
|
136
135
|
};
|
|
136
|
+
const toErrorStatus = (status) => {
|
|
137
|
+
if (status >= 400 && status < 600) {
|
|
138
|
+
return status;
|
|
139
|
+
}
|
|
140
|
+
return 500;
|
|
141
|
+
};
|
|
137
142
|
|
|
138
143
|
const RPCResponse = {
|
|
139
144
|
/**
|
|
@@ -460,7 +465,7 @@ async function useFetch(url, { parseAs = "json", ...options } = {}) {
|
|
|
460
465
|
createInternalError(parseError, {
|
|
461
466
|
message: body?.message ?? response.statusText,
|
|
462
467
|
code: "HTTP_ERROR",
|
|
463
|
-
status: response.status
|
|
468
|
+
status: toErrorStatus(response.status)
|
|
464
469
|
})
|
|
465
470
|
];
|
|
466
471
|
}
|
|
@@ -469,7 +474,7 @@ async function useFetch(url, { parseAs = "json", ...options } = {}) {
|
|
|
469
474
|
null,
|
|
470
475
|
createInternalError(parseError, {
|
|
471
476
|
code: "PARSE_ERROR",
|
|
472
|
-
status: response.status
|
|
477
|
+
status: toErrorStatus(response.status)
|
|
473
478
|
})
|
|
474
479
|
];
|
|
475
480
|
}
|
|
@@ -939,7 +944,7 @@ function develitWorker(Worker) {
|
|
|
939
944
|
const parseResult = z.safeParse(schema, input);
|
|
940
945
|
if (!parseResult.success) {
|
|
941
946
|
const parseError = {
|
|
942
|
-
status: 400,
|
|
947
|
+
status: toErrorStatus(400),
|
|
943
948
|
code: "INVALID_ACTION_INPUT",
|
|
944
949
|
message: z.prettifyError(parseResult.error)
|
|
945
950
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@develit-io/backend-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "Develit Backend SDK",
|
|
5
5
|
"author": "Develit.io",
|
|
6
6
|
"license": "ISC",
|
|
@@ -33,7 +33,6 @@
|
|
|
33
33
|
"drizzle-kit": "^0.31.6",
|
|
34
34
|
"drizzle-orm": "^0.44.7",
|
|
35
35
|
"h3": "^1.15.4",
|
|
36
|
-
"http-status-codes": "2.3.0",
|
|
37
36
|
"superjson": "^2.2.5"
|
|
38
37
|
},
|
|
39
38
|
"peerDependencies": {
|