@develit-io/backend-sdk 5.32.1 → 5.32.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +62 -31
- package/dist/index.d.ts +62 -31
- package/dist/index.mjs +15 -89
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -4,8 +4,8 @@ import * as drizzle_orm from 'drizzle-orm';
|
|
|
4
4
|
import { ExtractTablesWithRelations, DBQueryConfig, BuildQueryResult } from 'drizzle-orm';
|
|
5
5
|
import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
|
|
6
6
|
import { AnySQLiteTable } from 'drizzle-orm/sqlite-core';
|
|
7
|
+
import { z as z$1 } from 'zod';
|
|
7
8
|
import * as z from 'zod/v4/core';
|
|
8
|
-
import { CODES } from '@develit-io/general-codes';
|
|
9
9
|
import { StatusCodes, ReasonPhrases } from 'http-status-codes';
|
|
10
10
|
export { ReasonPhrases as InternalResponsePhrase, StatusCodes as InternalResponseStatus } from 'http-status-codes';
|
|
11
11
|
import { Queue } from '@cloudflare/workers-types';
|
|
@@ -67,36 +67,67 @@ interface AuditLogPayload<T> {
|
|
|
67
67
|
entityId?: string;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
declare const
|
|
71
|
-
declare const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
70
|
+
declare const ibanSchema: z$1.ZodString;
|
|
71
|
+
declare const bicSchema: z$1.ZodString;
|
|
72
|
+
declare const bankAccountMetadataSchema: z$1.ZodObject<{
|
|
73
|
+
id: z$1.ZodOptional<z$1.ZodString>;
|
|
74
|
+
number: z$1.ZodOptional<z$1.ZodString>;
|
|
75
|
+
bankCode: z$1.ZodOptional<z$1.ZodEnum<{
|
|
76
|
+
5051: "5051";
|
|
77
|
+
"0100": "0100";
|
|
78
|
+
"0300": "0300";
|
|
79
|
+
"0600": "0600";
|
|
80
|
+
"0710": "0710";
|
|
81
|
+
"0800": "0800";
|
|
82
|
+
2010: "2010";
|
|
83
|
+
2060: "2060";
|
|
84
|
+
2070: "2070";
|
|
85
|
+
2100: "2100";
|
|
86
|
+
2200: "2200";
|
|
87
|
+
2220: "2220";
|
|
88
|
+
2250: "2250";
|
|
89
|
+
2260: "2260";
|
|
90
|
+
2600: "2600";
|
|
91
|
+
2700: "2700";
|
|
92
|
+
3030: "3030";
|
|
93
|
+
3060: "3060";
|
|
94
|
+
3500: "3500";
|
|
95
|
+
4300: "4300";
|
|
96
|
+
5500: "5500";
|
|
97
|
+
5800: "5800";
|
|
98
|
+
6000: "6000";
|
|
99
|
+
6200: "6200";
|
|
100
|
+
6210: "6210";
|
|
101
|
+
6300: "6300";
|
|
102
|
+
6363: "6363";
|
|
103
|
+
6700: "6700";
|
|
104
|
+
6800: "6800";
|
|
105
|
+
7910: "7910";
|
|
106
|
+
7950: "7950";
|
|
107
|
+
7960: "7960";
|
|
108
|
+
7970: "7970";
|
|
109
|
+
7990: "7990";
|
|
110
|
+
8030: "8030";
|
|
111
|
+
8040: "8040";
|
|
112
|
+
8060: "8060";
|
|
113
|
+
8090: "8090";
|
|
114
|
+
8150: "8150";
|
|
115
|
+
8190: "8190";
|
|
116
|
+
8198: "8198";
|
|
117
|
+
8220: "8220";
|
|
118
|
+
8250: "8250";
|
|
119
|
+
8255: "8255";
|
|
120
|
+
8265: "8265";
|
|
121
|
+
8500: "8500";
|
|
122
|
+
}>>;
|
|
123
|
+
holderName: z$1.ZodOptional<z$1.ZodString>;
|
|
124
|
+
iban: z$1.ZodOptional<z$1.ZodString>;
|
|
125
|
+
address: z$1.ZodOptional<z$1.ZodString>;
|
|
126
|
+
swiftBic: z$1.ZodOptional<z$1.ZodString>;
|
|
127
|
+
bicCor: z$1.ZodOptional<z$1.ZodString>;
|
|
128
|
+
}, z$1.core.$strip>;
|
|
129
|
+
interface BankAccountMetadata extends z$1.infer<typeof bankAccountMetadataSchema> {
|
|
93
130
|
}
|
|
94
|
-
/**
|
|
95
|
-
* Zod schema for BankAccountMetadata validation
|
|
96
|
-
*/
|
|
97
|
-
declare const bankAccountMetadataSchema: z.$ZodObject<Readonly<Readonly<{
|
|
98
|
-
[k: string]: z.$ZodType<unknown, unknown, z.$ZodTypeInternals<unknown, unknown>>;
|
|
99
|
-
}>>, z.$ZodObjectConfig>;
|
|
100
131
|
|
|
101
132
|
interface CommandLogPayload<T = string> {
|
|
102
133
|
action: T;
|
|
@@ -475,5 +506,5 @@ interface WithRetryCounterOptions {
|
|
|
475
506
|
type AsyncMethod<TArgs extends unknown[] = unknown[], TResult = unknown> = (...args: TArgs) => Promise<TResult>;
|
|
476
507
|
declare function cloudflareQueue<TArgs extends unknown[] = unknown[], TResult = unknown>(options: WithRetryCounterOptions): (target: unknown, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<AsyncMethod<TArgs, TResult>>) => void;
|
|
477
508
|
|
|
478
|
-
export { DatabaseTransaction, ENVIRONMENT, RPCResponse, action, bankAccount, bankAccountBankCodeEnum, bankAccountCountryCodeEnum, bankAccountCurrencyEnum, bankAccountMetadataSchema, bankAccountPostgres, base, basePostgres, calculateExponentialBackoff, cloudflareQueue, createAuditLogWriter, createInternalError, defineCommand, derivePortFromId, develitWorker, durableObjectNamespaceIdFromName, first, firstOrError, getD1Credentials, getD1DatabaseIdFromWrangler, getDrizzleD1Config, getDrizzlePgConfig, getPgCredentials, getPgDatabaseIdFromWrangler, getPgLocalConnectionString, handleAction, handleActionResponse,
|
|
509
|
+
export { DatabaseTransaction, ENVIRONMENT, RPCResponse, action, bankAccount, bankAccountBankCodeEnum, bankAccountCountryCodeEnum, bankAccountCurrencyEnum, bankAccountMetadataSchema, bankAccountPostgres, base, basePostgres, bicSchema, calculateExponentialBackoff, cloudflareQueue, createAuditLogWriter, createInternalError, defineCommand, derivePortFromId, develitWorker, durableObjectNamespaceIdFromName, first, firstOrError, getD1Credentials, getD1DatabaseIdFromWrangler, getDrizzleD1Config, getDrizzlePgConfig, getPgCredentials, getPgDatabaseIdFromWrangler, getPgLocalConnectionString, handleAction, handleActionResponse, ibanSchema, isInternalError, paginationQuerySchema, paginationSchema, service, useFetch, useResult, useResultSync, uuidv4 };
|
|
479
510
|
export type { ActionExecution, ActionHandlerOptions, AuditLogWriter, BankAccountMetadata, Command, CommandLogPayload, DevelitWorkerMethods, Environment, GatewayResponse, IRPCResponse, IncludeRelation, InferResultType, InternalError, InternalErrorResponseStatus, Project, ValidatedInput };
|
package/dist/index.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import * as drizzle_orm from 'drizzle-orm';
|
|
|
4
4
|
import { ExtractTablesWithRelations, DBQueryConfig, BuildQueryResult } from 'drizzle-orm';
|
|
5
5
|
import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
|
|
6
6
|
import { AnySQLiteTable } from 'drizzle-orm/sqlite-core';
|
|
7
|
+
import { z as z$1 } from 'zod';
|
|
7
8
|
import * as z from 'zod/v4/core';
|
|
8
|
-
import { CODES } from '@develit-io/general-codes';
|
|
9
9
|
import { StatusCodes, ReasonPhrases } from 'http-status-codes';
|
|
10
10
|
export { ReasonPhrases as InternalResponsePhrase, StatusCodes as InternalResponseStatus } from 'http-status-codes';
|
|
11
11
|
import { Queue } from '@cloudflare/workers-types';
|
|
@@ -67,36 +67,67 @@ interface AuditLogPayload<T> {
|
|
|
67
67
|
entityId?: string;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
declare const
|
|
71
|
-
declare const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
70
|
+
declare const ibanSchema: z$1.ZodString;
|
|
71
|
+
declare const bicSchema: z$1.ZodString;
|
|
72
|
+
declare const bankAccountMetadataSchema: z$1.ZodObject<{
|
|
73
|
+
id: z$1.ZodOptional<z$1.ZodString>;
|
|
74
|
+
number: z$1.ZodOptional<z$1.ZodString>;
|
|
75
|
+
bankCode: z$1.ZodOptional<z$1.ZodEnum<{
|
|
76
|
+
5051: "5051";
|
|
77
|
+
"0100": "0100";
|
|
78
|
+
"0300": "0300";
|
|
79
|
+
"0600": "0600";
|
|
80
|
+
"0710": "0710";
|
|
81
|
+
"0800": "0800";
|
|
82
|
+
2010: "2010";
|
|
83
|
+
2060: "2060";
|
|
84
|
+
2070: "2070";
|
|
85
|
+
2100: "2100";
|
|
86
|
+
2200: "2200";
|
|
87
|
+
2220: "2220";
|
|
88
|
+
2250: "2250";
|
|
89
|
+
2260: "2260";
|
|
90
|
+
2600: "2600";
|
|
91
|
+
2700: "2700";
|
|
92
|
+
3030: "3030";
|
|
93
|
+
3060: "3060";
|
|
94
|
+
3500: "3500";
|
|
95
|
+
4300: "4300";
|
|
96
|
+
5500: "5500";
|
|
97
|
+
5800: "5800";
|
|
98
|
+
6000: "6000";
|
|
99
|
+
6200: "6200";
|
|
100
|
+
6210: "6210";
|
|
101
|
+
6300: "6300";
|
|
102
|
+
6363: "6363";
|
|
103
|
+
6700: "6700";
|
|
104
|
+
6800: "6800";
|
|
105
|
+
7910: "7910";
|
|
106
|
+
7950: "7950";
|
|
107
|
+
7960: "7960";
|
|
108
|
+
7970: "7970";
|
|
109
|
+
7990: "7990";
|
|
110
|
+
8030: "8030";
|
|
111
|
+
8040: "8040";
|
|
112
|
+
8060: "8060";
|
|
113
|
+
8090: "8090";
|
|
114
|
+
8150: "8150";
|
|
115
|
+
8190: "8190";
|
|
116
|
+
8198: "8198";
|
|
117
|
+
8220: "8220";
|
|
118
|
+
8250: "8250";
|
|
119
|
+
8255: "8255";
|
|
120
|
+
8265: "8265";
|
|
121
|
+
8500: "8500";
|
|
122
|
+
}>>;
|
|
123
|
+
holderName: z$1.ZodOptional<z$1.ZodString>;
|
|
124
|
+
iban: z$1.ZodOptional<z$1.ZodString>;
|
|
125
|
+
address: z$1.ZodOptional<z$1.ZodString>;
|
|
126
|
+
swiftBic: z$1.ZodOptional<z$1.ZodString>;
|
|
127
|
+
bicCor: z$1.ZodOptional<z$1.ZodString>;
|
|
128
|
+
}, z$1.core.$strip>;
|
|
129
|
+
interface BankAccountMetadata extends z$1.infer<typeof bankAccountMetadataSchema> {
|
|
93
130
|
}
|
|
94
|
-
/**
|
|
95
|
-
* Zod schema for BankAccountMetadata validation
|
|
96
|
-
*/
|
|
97
|
-
declare const bankAccountMetadataSchema: z.$ZodObject<Readonly<Readonly<{
|
|
98
|
-
[k: string]: z.$ZodType<unknown, unknown, z.$ZodTypeInternals<unknown, unknown>>;
|
|
99
|
-
}>>, z.$ZodObjectConfig>;
|
|
100
131
|
|
|
101
132
|
interface CommandLogPayload<T = string> {
|
|
102
133
|
action: T;
|
|
@@ -475,5 +506,5 @@ interface WithRetryCounterOptions {
|
|
|
475
506
|
type AsyncMethod<TArgs extends unknown[] = unknown[], TResult = unknown> = (...args: TArgs) => Promise<TResult>;
|
|
476
507
|
declare function cloudflareQueue<TArgs extends unknown[] = unknown[], TResult = unknown>(options: WithRetryCounterOptions): (target: unknown, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<AsyncMethod<TArgs, TResult>>) => void;
|
|
477
508
|
|
|
478
|
-
export { DatabaseTransaction, ENVIRONMENT, RPCResponse, action, bankAccount, bankAccountBankCodeEnum, bankAccountCountryCodeEnum, bankAccountCurrencyEnum, bankAccountMetadataSchema, bankAccountPostgres, base, basePostgres, calculateExponentialBackoff, cloudflareQueue, createAuditLogWriter, createInternalError, defineCommand, derivePortFromId, develitWorker, durableObjectNamespaceIdFromName, first, firstOrError, getD1Credentials, getD1DatabaseIdFromWrangler, getDrizzleD1Config, getDrizzlePgConfig, getPgCredentials, getPgDatabaseIdFromWrangler, getPgLocalConnectionString, handleAction, handleActionResponse,
|
|
509
|
+
export { DatabaseTransaction, ENVIRONMENT, RPCResponse, action, bankAccount, bankAccountBankCodeEnum, bankAccountCountryCodeEnum, bankAccountCurrencyEnum, bankAccountMetadataSchema, bankAccountPostgres, base, basePostgres, bicSchema, calculateExponentialBackoff, cloudflareQueue, createAuditLogWriter, createInternalError, defineCommand, derivePortFromId, develitWorker, durableObjectNamespaceIdFromName, first, firstOrError, getD1Credentials, getD1DatabaseIdFromWrangler, getDrizzleD1Config, getDrizzlePgConfig, getPgCredentials, getPgDatabaseIdFromWrangler, getPgLocalConnectionString, handleAction, handleActionResponse, ibanSchema, isInternalError, paginationQuerySchema, paginationSchema, service, useFetch, useResult, useResultSync, uuidv4 };
|
|
479
510
|
export type { ActionExecution, ActionHandlerOptions, AuditLogWriter, BankAccountMetadata, Command, CommandLogPayload, DevelitWorkerMethods, Environment, GatewayResponse, IRPCResponse, IncludeRelation, InferResultType, InternalError, InternalErrorResponseStatus, Project, ValidatedInput };
|
package/dist/index.mjs
CHANGED
|
@@ -2,6 +2,7 @@ import { sql } from 'drizzle-orm';
|
|
|
2
2
|
import { timestamp, uuid, pgEnum, text as text$1 } from 'drizzle-orm/pg-core';
|
|
3
3
|
import { integer, text } from 'drizzle-orm/sqlite-core';
|
|
4
4
|
import { COUNTRY_CODES_2, CURRENCY_CODES, BANK_CODES } from '@develit-io/general-codes';
|
|
5
|
+
import { z as z$1 } from 'zod';
|
|
5
6
|
import * as z from 'zod/v4/core';
|
|
6
7
|
import 'http-status-codes';
|
|
7
8
|
import { createError } from 'h3';
|
|
@@ -62,96 +63,21 @@ const bankAccountPostgres = {
|
|
|
62
63
|
|
|
63
64
|
const ENVIRONMENT = ["dev", "test", "staging", "production"];
|
|
64
65
|
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
checks: [
|
|
68
|
-
new z.$ZodCheckMinLength({
|
|
69
|
-
check: "min_length",
|
|
70
|
-
minimum: 1
|
|
71
|
-
}),
|
|
72
|
-
new z.$ZodCheckRegex({
|
|
73
|
-
check: "string_format",
|
|
74
|
-
format: "regex",
|
|
75
|
-
pattern: /^[A-Z]{2}[0-9]{2}[A-Z0-9]{11,30}$/
|
|
76
|
-
})
|
|
77
|
-
]
|
|
66
|
+
const ibanSchema = z$1.string().min(1).regex(/^[A-Z]{2}[0-9]{2}[A-Z0-9]{11,30}$/, {
|
|
67
|
+
message: "Invalid IBAN format"
|
|
78
68
|
});
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
checks: [
|
|
82
|
-
new z.$ZodCheckMinLength({
|
|
83
|
-
check: "min_length",
|
|
84
|
-
minimum: 1
|
|
85
|
-
}),
|
|
86
|
-
new z.$ZodCheckRegex({
|
|
87
|
-
check: "string_format",
|
|
88
|
-
format: "regex",
|
|
89
|
-
pattern: /^[A-Z]{6}[A-Z0-9]{2}([A-Z0-9]{3})?$/
|
|
90
|
-
})
|
|
91
|
-
]
|
|
69
|
+
const bicSchema = z$1.string().min(1).regex(/^[A-Z]{6}[A-Z0-9]{2}([A-Z0-9]{3})?$/, {
|
|
70
|
+
message: "Invalid SWIFT/BIC format"
|
|
92
71
|
});
|
|
93
|
-
const bankAccountMetadataSchema =
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}),
|
|
103
|
-
number: new z.$ZodOptional({
|
|
104
|
-
type: "optional",
|
|
105
|
-
innerType: new z.$ZodString({
|
|
106
|
-
type: "string",
|
|
107
|
-
checks: []
|
|
108
|
-
})
|
|
109
|
-
}),
|
|
110
|
-
bankCode: new z.$ZodOptional({
|
|
111
|
-
type: "optional",
|
|
112
|
-
innerType: new z.$ZodEnum({
|
|
113
|
-
type: "enum",
|
|
114
|
-
entries: Object.fromEntries(
|
|
115
|
-
BANK_CODES.map((code) => [code, code])
|
|
116
|
-
)
|
|
117
|
-
})
|
|
118
|
-
}),
|
|
119
|
-
holderName: new z.$ZodOptional({
|
|
120
|
-
type: "optional",
|
|
121
|
-
innerType: new z.$ZodString({
|
|
122
|
-
type: "string",
|
|
123
|
-
checks: []
|
|
124
|
-
})
|
|
125
|
-
}),
|
|
126
|
-
iban: new z.$ZodOptional({
|
|
127
|
-
type: "optional",
|
|
128
|
-
innerType: new z.$ZodString({
|
|
129
|
-
type: "string",
|
|
130
|
-
checks: []
|
|
131
|
-
})
|
|
132
|
-
}),
|
|
133
|
-
address: new z.$ZodOptional({
|
|
134
|
-
type: "optional",
|
|
135
|
-
innerType: new z.$ZodString({
|
|
136
|
-
type: "string",
|
|
137
|
-
checks: []
|
|
138
|
-
})
|
|
139
|
-
}),
|
|
140
|
-
swiftBic: new z.$ZodOptional({
|
|
141
|
-
type: "optional",
|
|
142
|
-
innerType: new z.$ZodString({
|
|
143
|
-
type: "string",
|
|
144
|
-
checks: []
|
|
145
|
-
})
|
|
146
|
-
}),
|
|
147
|
-
bicCor: new z.$ZodOptional({
|
|
148
|
-
type: "optional",
|
|
149
|
-
innerType: new z.$ZodString({
|
|
150
|
-
type: "string",
|
|
151
|
-
checks: []
|
|
152
|
-
})
|
|
153
|
-
})
|
|
154
|
-
}
|
|
72
|
+
const bankAccountMetadataSchema = z$1.object({
|
|
73
|
+
id: z$1.string().optional(),
|
|
74
|
+
number: z$1.string().optional(),
|
|
75
|
+
bankCode: z$1.enum(BANK_CODES).optional(),
|
|
76
|
+
holderName: z$1.string().optional(),
|
|
77
|
+
iban: ibanSchema.optional(),
|
|
78
|
+
address: z$1.string().optional(),
|
|
79
|
+
swiftBic: bicSchema.optional(),
|
|
80
|
+
bicCor: bicSchema.optional()
|
|
155
81
|
});
|
|
156
82
|
|
|
157
83
|
const paginationQuerySchema = new z.$ZodObject({
|
|
@@ -788,4 +714,4 @@ function develitWorker(Worker) {
|
|
|
788
714
|
return DevelitWorker;
|
|
789
715
|
}
|
|
790
716
|
|
|
791
|
-
export { DatabaseTransaction, ENVIRONMENT, RPCResponse, action, bankAccount, bankAccountBankCodeEnum, bankAccountCountryCodeEnum, bankAccountCurrencyEnum, bankAccountMetadataSchema, bankAccountPostgres, base, basePostgres, calculateExponentialBackoff, cloudflareQueue, createAuditLogWriter, createInternalError, defineCommand, derivePortFromId, develitWorker, durableObjectNamespaceIdFromName, first, firstOrError, getD1Credentials, getD1DatabaseIdFromWrangler, getDrizzleD1Config, getDrizzlePgConfig, getPgCredentials, getPgDatabaseIdFromWrangler, getPgLocalConnectionString, handleAction, handleActionResponse,
|
|
717
|
+
export { DatabaseTransaction, ENVIRONMENT, RPCResponse, action, bankAccount, bankAccountBankCodeEnum, bankAccountCountryCodeEnum, bankAccountCurrencyEnum, bankAccountMetadataSchema, bankAccountPostgres, base, basePostgres, bicSchema, calculateExponentialBackoff, cloudflareQueue, createAuditLogWriter, createInternalError, defineCommand, derivePortFromId, develitWorker, durableObjectNamespaceIdFromName, first, firstOrError, getD1Credentials, getD1DatabaseIdFromWrangler, getDrizzleD1Config, getDrizzlePgConfig, getPgCredentials, getPgDatabaseIdFromWrangler, getPgLocalConnectionString, handleAction, handleActionResponse, ibanSchema, isInternalError, paginationQuerySchema, paginationSchema, service, useFetch, useResult, useResultSync, uuidv4 };
|