@develit-io/backend-sdk 5.15.2 → 5.16.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.cts CHANGED
@@ -4,7 +4,6 @@ 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 * as comment_json from 'comment-json';
8
7
  import { StatusCodes, ReasonPhrases } from 'http-status-codes';
9
8
  export { ReasonPhrases as InternalResponsePhrase, StatusCodes as InternalResponseStatus } from 'http-status-codes';
10
9
  import * as z from 'zod/v4/core';
@@ -25,8 +24,283 @@ declare const basePostgres: {
25
24
  deletedAt: drizzle_orm.HasDefault<drizzle_orm_pg_core.PgTimestampBuilderInitial<"deleted_at">>;
26
25
  };
27
26
 
27
+ declare const bankAccount: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
28
+ name: "bank_account";
29
+ schema: undefined;
30
+ columns: {
31
+ holderName: drizzle_orm_sqlite_core.SQLiteColumn<{
32
+ name: "holder_name";
33
+ tableName: "bank_account";
34
+ dataType: "string";
35
+ columnType: "SQLiteText";
36
+ data: string;
37
+ driverParam: string;
38
+ notNull: true;
39
+ hasDefault: false;
40
+ isPrimaryKey: false;
41
+ isAutoincrement: false;
42
+ hasRuntimeDefault: false;
43
+ enumValues: [string, ...string[]];
44
+ baseColumn: never;
45
+ identity: undefined;
46
+ generated: undefined;
47
+ }, {}, {
48
+ length: number | undefined;
49
+ }>;
50
+ number: drizzle_orm_sqlite_core.SQLiteColumn<{
51
+ name: "number";
52
+ tableName: "bank_account";
53
+ dataType: "string";
54
+ columnType: "SQLiteText";
55
+ data: string;
56
+ driverParam: string;
57
+ notNull: true;
58
+ hasDefault: false;
59
+ isPrimaryKey: false;
60
+ isAutoincrement: false;
61
+ hasRuntimeDefault: false;
62
+ enumValues: [string, ...string[]];
63
+ baseColumn: never;
64
+ identity: undefined;
65
+ generated: undefined;
66
+ }, {}, {
67
+ length: number | undefined;
68
+ }>;
69
+ bankCode: drizzle_orm_sqlite_core.SQLiteColumn<{
70
+ name: "bank_code";
71
+ tableName: "bank_account";
72
+ dataType: "string";
73
+ columnType: "SQLiteText";
74
+ data: "0100" | "0300" | "0600" | "0710" | "0800" | "2010" | "2060" | "2070" | "2100" | "2200" | "2220" | "2250" | "2260" | "2600" | "2700" | "3030" | "3060" | "3500" | "4300" | "5500" | "5800" | "6000" | "6200" | "6210" | "6300" | "6363" | "6700" | "6800" | "7910" | "7950" | "7960" | "7970" | "7990" | "8030" | "8040" | "8060" | "8090" | "8150" | "8190" | "8198" | "8220" | "8250" | "8255" | "8265" | "8500";
75
+ driverParam: string;
76
+ notNull: true;
77
+ hasDefault: false;
78
+ isPrimaryKey: false;
79
+ isAutoincrement: false;
80
+ hasRuntimeDefault: false;
81
+ enumValues: [string, ...string[]];
82
+ baseColumn: never;
83
+ identity: undefined;
84
+ generated: undefined;
85
+ }, {}, {
86
+ length: number | undefined;
87
+ $type: "0100" | "0300" | "0600" | "0710" | "0800" | "2010" | "2060" | "2070" | "2100" | "2200" | "2220" | "2250" | "2260" | "2600" | "2700" | "3030" | "3060" | "3500" | "4300" | "5500" | "5800" | "6000" | "6200" | "6210" | "6300" | "6363" | "6700" | "6800" | "7910" | "7950" | "7960" | "7970" | "7990" | "8030" | "8040" | "8060" | "8090" | "8150" | "8190" | "8198" | "8220" | "8250" | "8255" | "8265" | "8500";
88
+ }>;
89
+ iban: drizzle_orm_sqlite_core.SQLiteColumn<{
90
+ name: "iban";
91
+ tableName: "bank_account";
92
+ dataType: "string";
93
+ columnType: "SQLiteText";
94
+ data: string;
95
+ driverParam: string;
96
+ notNull: true;
97
+ hasDefault: false;
98
+ isPrimaryKey: false;
99
+ isAutoincrement: false;
100
+ hasRuntimeDefault: false;
101
+ enumValues: [string, ...string[]];
102
+ baseColumn: never;
103
+ identity: undefined;
104
+ generated: undefined;
105
+ }, {}, {
106
+ length: number | undefined;
107
+ }>;
108
+ bic: drizzle_orm_sqlite_core.SQLiteColumn<{
109
+ name: "bic";
110
+ tableName: "bank_account";
111
+ dataType: "string";
112
+ columnType: "SQLiteText";
113
+ data: string;
114
+ driverParam: string;
115
+ notNull: true;
116
+ hasDefault: false;
117
+ isPrimaryKey: false;
118
+ isAutoincrement: false;
119
+ hasRuntimeDefault: false;
120
+ enumValues: [string, ...string[]];
121
+ baseColumn: never;
122
+ identity: undefined;
123
+ generated: undefined;
124
+ }, {}, {
125
+ length: number | undefined;
126
+ }>;
127
+ currency: drizzle_orm_sqlite_core.SQLiteColumn<{
128
+ name: "currency";
129
+ tableName: "bank_account";
130
+ dataType: "string";
131
+ columnType: "SQLiteText";
132
+ data: "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";
133
+ driverParam: string;
134
+ notNull: false;
135
+ hasDefault: false;
136
+ isPrimaryKey: false;
137
+ isAutoincrement: false;
138
+ hasRuntimeDefault: false;
139
+ enumValues: [string, ...string[]];
140
+ baseColumn: never;
141
+ identity: undefined;
142
+ generated: undefined;
143
+ }, {}, {
144
+ length: number | undefined;
145
+ $type: "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";
146
+ }>;
147
+ countryCode: drizzle_orm_sqlite_core.SQLiteColumn<{
148
+ name: "country_code";
149
+ tableName: "bank_account";
150
+ dataType: "string";
151
+ columnType: "SQLiteText";
152
+ data: string;
153
+ driverParam: string;
154
+ notNull: true;
155
+ hasDefault: false;
156
+ isPrimaryKey: false;
157
+ isAutoincrement: false;
158
+ hasRuntimeDefault: false;
159
+ enumValues: [string, ...string[]];
160
+ baseColumn: never;
161
+ identity: undefined;
162
+ generated: undefined;
163
+ }, {}, {
164
+ length: number | undefined;
165
+ }>;
166
+ };
167
+ dialect: "sqlite";
168
+ }>;
169
+ declare const bankAccountPostgres: drizzle_orm_pg_core.PgTableWithColumns<{
170
+ name: "bank_account";
171
+ schema: undefined;
172
+ columns: {
173
+ holderName: drizzle_orm_pg_core.PgColumn<{
174
+ name: "holder_name";
175
+ tableName: "bank_account";
176
+ dataType: "string";
177
+ columnType: "PgText";
178
+ data: string;
179
+ driverParam: string;
180
+ notNull: true;
181
+ hasDefault: false;
182
+ isPrimaryKey: false;
183
+ isAutoincrement: false;
184
+ hasRuntimeDefault: false;
185
+ enumValues: [string, ...string[]];
186
+ baseColumn: never;
187
+ identity: undefined;
188
+ generated: undefined;
189
+ }, {}, {}>;
190
+ number: drizzle_orm_pg_core.PgColumn<{
191
+ name: "number";
192
+ tableName: "bank_account";
193
+ dataType: "string";
194
+ columnType: "PgText";
195
+ data: string;
196
+ driverParam: string;
197
+ notNull: true;
198
+ hasDefault: false;
199
+ isPrimaryKey: false;
200
+ isAutoincrement: false;
201
+ hasRuntimeDefault: false;
202
+ enumValues: [string, ...string[]];
203
+ baseColumn: never;
204
+ identity: undefined;
205
+ generated: undefined;
206
+ }, {}, {}>;
207
+ bankCode: drizzle_orm_pg_core.PgColumn<{
208
+ name: "bank_code";
209
+ tableName: "bank_account";
210
+ dataType: "string";
211
+ columnType: "PgText";
212
+ data: "0100" | "0300" | "0600" | "0710" | "0800" | "2010" | "2060" | "2070" | "2100" | "2200" | "2220" | "2250" | "2260" | "2600" | "2700" | "3030" | "3060" | "3500" | "4300" | "5500" | "5800" | "6000" | "6200" | "6210" | "6300" | "6363" | "6700" | "6800" | "7910" | "7950" | "7960" | "7970" | "7990" | "8030" | "8040" | "8060" | "8090" | "8150" | "8190" | "8198" | "8220" | "8250" | "8255" | "8265" | "8500";
213
+ driverParam: string;
214
+ notNull: true;
215
+ hasDefault: false;
216
+ isPrimaryKey: false;
217
+ isAutoincrement: false;
218
+ hasRuntimeDefault: false;
219
+ enumValues: [string, ...string[]];
220
+ baseColumn: never;
221
+ identity: undefined;
222
+ generated: undefined;
223
+ }, {}, {
224
+ $type: "0100" | "0300" | "0600" | "0710" | "0800" | "2010" | "2060" | "2070" | "2100" | "2200" | "2220" | "2250" | "2260" | "2600" | "2700" | "3030" | "3060" | "3500" | "4300" | "5500" | "5800" | "6000" | "6200" | "6210" | "6300" | "6363" | "6700" | "6800" | "7910" | "7950" | "7960" | "7970" | "7990" | "8030" | "8040" | "8060" | "8090" | "8150" | "8190" | "8198" | "8220" | "8250" | "8255" | "8265" | "8500";
225
+ }>;
226
+ iban: drizzle_orm_pg_core.PgColumn<{
227
+ name: "iban";
228
+ tableName: "bank_account";
229
+ dataType: "string";
230
+ columnType: "PgText";
231
+ data: string;
232
+ driverParam: string;
233
+ notNull: true;
234
+ hasDefault: false;
235
+ isPrimaryKey: false;
236
+ isAutoincrement: false;
237
+ hasRuntimeDefault: false;
238
+ enumValues: [string, ...string[]];
239
+ baseColumn: never;
240
+ identity: undefined;
241
+ generated: undefined;
242
+ }, {}, {}>;
243
+ bic: drizzle_orm_pg_core.PgColumn<{
244
+ name: "bic";
245
+ tableName: "bank_account";
246
+ dataType: "string";
247
+ columnType: "PgText";
248
+ data: string;
249
+ driverParam: string;
250
+ notNull: true;
251
+ hasDefault: false;
252
+ isPrimaryKey: false;
253
+ isAutoincrement: false;
254
+ hasRuntimeDefault: false;
255
+ enumValues: [string, ...string[]];
256
+ baseColumn: never;
257
+ identity: undefined;
258
+ generated: undefined;
259
+ }, {}, {}>;
260
+ currency: drizzle_orm_pg_core.PgColumn<{
261
+ name: "currency";
262
+ tableName: "bank_account";
263
+ dataType: "string";
264
+ columnType: "PgText";
265
+ data: "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";
266
+ driverParam: string;
267
+ notNull: false;
268
+ hasDefault: false;
269
+ isPrimaryKey: false;
270
+ isAutoincrement: false;
271
+ hasRuntimeDefault: false;
272
+ enumValues: [string, ...string[]];
273
+ baseColumn: never;
274
+ identity: undefined;
275
+ generated: undefined;
276
+ }, {}, {
277
+ $type: "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";
278
+ }>;
279
+ countryCode: drizzle_orm_pg_core.PgColumn<{
280
+ name: "country_code";
281
+ tableName: "bank_account";
282
+ dataType: "string";
283
+ columnType: "PgText";
284
+ data: string;
285
+ driverParam: string;
286
+ notNull: true;
287
+ hasDefault: false;
288
+ isPrimaryKey: false;
289
+ isAutoincrement: false;
290
+ hasRuntimeDefault: false;
291
+ enumValues: [string, ...string[]];
292
+ baseColumn: never;
293
+ identity: undefined;
294
+ generated: undefined;
295
+ }, {}, {}>;
296
+ };
297
+ dialect: "pg";
298
+ }>;
299
+
28
300
  type Project = 'creditio' | 'fp' | 'mdm' | 'moneio' | 'txs';
29
301
 
302
+ type Resource = 'kv' | 'd1' | 'queue' | 'r2' | 'worker' | 'service' | 'orchestrator';
303
+
30
304
  type Environment = number | 'dev' | 'test' | 'staging' | 'production';
31
305
 
32
306
  interface SstInstance {
@@ -43,6 +317,61 @@ declare class Infrastructure {
43
317
  environment: Environment;
44
318
  sst: SstInstance;
45
319
  });
320
+ composeBindingName({ resource, resourceName, bindingName, }: {
321
+ resource: Resource;
322
+ resourceName: string;
323
+ bindingName?: string;
324
+ }): string;
325
+ composeResourceName({ resourceName }: {
326
+ resourceName: string;
327
+ }): string;
328
+ composeKvArguments({ resourceName }: {
329
+ resourceName: string;
330
+ }): {
331
+ transform: {
332
+ namespace: {
333
+ title: string;
334
+ };
335
+ };
336
+ };
337
+ composeD1Arguments({ resourceName }: {
338
+ resourceName: string;
339
+ }): {
340
+ transform: {
341
+ database: {
342
+ name: string;
343
+ primaryLocationHint: string;
344
+ };
345
+ };
346
+ };
347
+ composeQueueArguments({ resourceName, deliveryDelay, messageRetentionPeriod, }: {
348
+ resourceName: string;
349
+ deliveryDelay?: number;
350
+ messageRetentionPeriod?: number;
351
+ }): {
352
+ transform: {
353
+ queue: {
354
+ queueName: string;
355
+ settings: {
356
+ deliveryDelay: number;
357
+ messageRetentionPeriod: number;
358
+ };
359
+ };
360
+ };
361
+ };
362
+ composeR2Arguments({ resourceName, storageClass, }: {
363
+ resourceName: string;
364
+ storageClass?: 'Standard' | 'InfrequentAccess';
365
+ }): {
366
+ transform: {
367
+ bucket: {
368
+ name: string;
369
+ jurisdiction: string;
370
+ location: string;
371
+ storageClass: "Standard" | "InfrequentAccess";
372
+ };
373
+ };
374
+ };
46
375
  /**
47
376
  * Creates an instance of Cloudflare KV.
48
377
  */
@@ -109,12 +438,6 @@ declare class Infrastructure {
109
438
  }): any;
110
439
  }
111
440
 
112
- declare function loadWorkerConfig({ path }: {
113
- path: string;
114
- }): Promise<comment_json.CommentJSONValue>;
115
-
116
- type Resource = 'kv' | 'd1' | 'queue' | 'r2' | 'worker' | 'service' | 'orchestrator';
117
-
118
441
  type InternalErrorResponseStatus = Exclude<StatusCodes, 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207>;
119
442
  interface InternalError {
120
443
  status: InternalErrorResponseStatus;
@@ -177,16 +500,6 @@ declare const paginationSchema: z.$ZodObject<Readonly<Readonly<{
177
500
  [k: string]: z.$ZodType<unknown, unknown, z.$ZodTypeInternals<unknown, unknown>>;
178
501
  }>>, z.$ZodObjectConfig>;
179
502
 
180
- declare const composeBindingName: ({ resource, resourceName, bindingName, }: {
181
- resource: Resource;
182
- resourceName: string;
183
- bindingName?: string;
184
- }) => string;
185
-
186
- declare const validateEnvironment: (environment: string) => Environment;
187
-
188
- declare const ENVIRONMENT: string[];
189
-
190
503
  declare const handleActionResponse: <T>({ error, status, message, data, }: {
191
504
  error: boolean;
192
505
  status: number;
@@ -507,5 +820,5 @@ interface WithRetryCounterOptions {
507
820
  type AsyncMethod<TArgs extends unknown[] = unknown[], TResult = unknown> = (...args: TArgs) => Promise<TResult>;
508
821
  declare function cloudflareQueue<TArgs extends unknown[] = unknown[], TResult = unknown>(options: WithRetryCounterOptions): (target: unknown, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<AsyncMethod<TArgs, TResult>>) => void;
509
822
 
510
- export { DatabaseTransaction, ENVIRONMENT, Infrastructure, RPCResponse, action, base, basePostgres, calculateExponentialBackoff, cloudflareQueue, composeBindingName, createAuditLogWriter, createInternalError, defineCommand, derivePortFromId, develitWorker, durableObjectNamespaceIdFromName, first, firstOrError, getD1Credentials, getD1DatabaseIdFromWrangler, getDrizzleD1Config, getDrizzlePgConfig, getPgCredentials, getPgDatabaseIdFromWrangler, getPgLocalConnectionString, handleAction, handleActionResponse, ibanZodSchema, isInternalError, loadWorkerConfig, paginationQuerySchema, paginationSchema, service, swiftZodSchema, useResult, useResultSync, uuidv4, validateEnvironment };
823
+ export { DatabaseTransaction, Infrastructure, RPCResponse, action, bankAccount, bankAccountPostgres, base, basePostgres, calculateExponentialBackoff, cloudflareQueue, createAuditLogWriter, createInternalError, defineCommand, derivePortFromId, develitWorker, durableObjectNamespaceIdFromName, first, firstOrError, getD1Credentials, getD1DatabaseIdFromWrangler, getDrizzleD1Config, getDrizzlePgConfig, getPgCredentials, getPgDatabaseIdFromWrangler, getPgLocalConnectionString, handleAction, handleActionResponse, ibanZodSchema, isInternalError, paginationQuerySchema, paginationSchema, service, swiftZodSchema, useResult, useResultSync, uuidv4 };
511
824
  export type { ActionExecution, ActionHandlerOptions, AuditLogWriter, Command, CommandLogPayload, DevelitWorkerMethods, Environment, GatewayResponse, IRPCResponse, IncludeRelation, InferResultType, InternalError, InternalErrorResponseStatus, Project, ValidatedInput };