@develit-io/backend-sdk 5.15.1 → 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.cjs +93 -88
- package/dist/index.d.cts +328 -12
- package/dist/index.d.mts +328 -12
- package/dist/index.d.ts +328 -12
- package/dist/index.mjs +94 -88
- package/package.json +1 -2
package/dist/index.cjs
CHANGED
|
@@ -7,7 +7,6 @@ const text = require('@std/text');
|
|
|
7
7
|
require('http-status-codes');
|
|
8
8
|
const z = require('zod/v4/core');
|
|
9
9
|
const h3 = require('h3');
|
|
10
|
-
const consola = require('consola');
|
|
11
10
|
const fs = require('fs');
|
|
12
11
|
const crypto$1 = require('node:crypto');
|
|
13
12
|
const path = require('path');
|
|
@@ -52,82 +51,25 @@ const basePostgres = {
|
|
|
52
51
|
}).default(drizzleOrm.sql`null`)
|
|
53
52
|
};
|
|
54
53
|
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
})
|
|
73
|
-
return {
|
|
74
|
-
transform: {
|
|
75
|
-
namespace: {
|
|
76
|
-
title: resourceName
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
const composeQueueArguments = ({
|
|
83
|
-
resourceName,
|
|
84
|
-
deliveryDelay = 5,
|
|
85
|
-
messageRetentionPeriod = 259200
|
|
86
|
-
}) => {
|
|
87
|
-
return {
|
|
88
|
-
transform: {
|
|
89
|
-
queue: {
|
|
90
|
-
queueName: resourceName,
|
|
91
|
-
settings: {
|
|
92
|
-
deliveryDelay,
|
|
93
|
-
messageRetentionPeriod
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
const composeR2Arguments = ({
|
|
101
|
-
resourceName,
|
|
102
|
-
storageClass = "Standard"
|
|
103
|
-
}) => {
|
|
104
|
-
return {
|
|
105
|
-
transform: {
|
|
106
|
-
bucket: {
|
|
107
|
-
name: resourceName,
|
|
108
|
-
jurisdiction: "eu",
|
|
109
|
-
location: "weur",
|
|
110
|
-
storageClass
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
const composeBindingName = ({
|
|
117
|
-
resource,
|
|
118
|
-
resourceName,
|
|
119
|
-
bindingName
|
|
120
|
-
}) => {
|
|
121
|
-
const convertedBindingName = bindingName ? text.toSnakeCase(bindingName) : `${text.toSnakeCase(resourceName)}_${resource}`;
|
|
122
|
-
return convertedBindingName.toUpperCase();
|
|
123
|
-
};
|
|
54
|
+
const bankAccount = sqliteCore.sqliteTable("bank_account", {
|
|
55
|
+
holderName: sqliteCore.text("holder_name").notNull(),
|
|
56
|
+
number: sqliteCore.text("number").notNull(),
|
|
57
|
+
bankCode: sqliteCore.text("bank_code").$type().notNull(),
|
|
58
|
+
iban: sqliteCore.text("iban").notNull(),
|
|
59
|
+
bic: sqliteCore.text("bic").notNull(),
|
|
60
|
+
currency: sqliteCore.text("currency").$type(),
|
|
61
|
+
countryCode: sqliteCore.text("country_code").notNull()
|
|
62
|
+
});
|
|
63
|
+
const bankAccountPostgres = pgCore.pgTable("bank_account", {
|
|
64
|
+
holderName: pgCore.text("holder_name").notNull(),
|
|
65
|
+
number: pgCore.text("number").notNull(),
|
|
66
|
+
bankCode: pgCore.text("bank_code").$type().notNull(),
|
|
67
|
+
iban: pgCore.text("iban").notNull(),
|
|
68
|
+
bic: pgCore.text("bic").notNull(),
|
|
69
|
+
currency: pgCore.text("currency").$type(),
|
|
70
|
+
countryCode: pgCore.text("country_code").notNull()
|
|
71
|
+
});
|
|
124
72
|
|
|
125
|
-
const validateEnvironment = (environment) => {
|
|
126
|
-
if (ENVIRONMENT.includes(environment)) {
|
|
127
|
-
return environment;
|
|
128
|
-
}
|
|
129
|
-
return Number(environment);
|
|
130
|
-
};
|
|
131
73
|
class Infrastructure {
|
|
132
74
|
project;
|
|
133
75
|
environment;
|
|
@@ -142,9 +84,73 @@ class Infrastructure {
|
|
|
142
84
|
this.sst = sst;
|
|
143
85
|
}
|
|
144
86
|
// TODO(Pookensivee): Make tests for this util
|
|
87
|
+
composeBindingName({
|
|
88
|
+
resource,
|
|
89
|
+
resourceName,
|
|
90
|
+
bindingName
|
|
91
|
+
}) {
|
|
92
|
+
const convertedBindingName = bindingName ? text.toSnakeCase(bindingName) : `${text.toSnakeCase(resourceName)}_${resource}`;
|
|
93
|
+
return convertedBindingName.toUpperCase();
|
|
94
|
+
}
|
|
95
|
+
// TODO(Pookensivee): Make tests for this util
|
|
145
96
|
composeResourceName({ resourceName }) {
|
|
146
97
|
return `${this.project}-${resourceName}-${this.environment}`;
|
|
147
98
|
}
|
|
99
|
+
// TODO(Pookensivee): Make tests for this util
|
|
100
|
+
composeKvArguments({ resourceName }) {
|
|
101
|
+
return {
|
|
102
|
+
transform: {
|
|
103
|
+
namespace: {
|
|
104
|
+
title: resourceName
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
// TODO(Pookensivee): Make tests for this util
|
|
110
|
+
composeD1Arguments({ resourceName }) {
|
|
111
|
+
return {
|
|
112
|
+
transform: {
|
|
113
|
+
database: {
|
|
114
|
+
name: resourceName,
|
|
115
|
+
primaryLocationHint: "weur"
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
// TODO(Pookensivee): Make tests for this util
|
|
121
|
+
composeQueueArguments({
|
|
122
|
+
resourceName,
|
|
123
|
+
deliveryDelay = 5,
|
|
124
|
+
messageRetentionPeriod = 259200
|
|
125
|
+
}) {
|
|
126
|
+
return {
|
|
127
|
+
transform: {
|
|
128
|
+
queue: {
|
|
129
|
+
queueName: resourceName,
|
|
130
|
+
settings: {
|
|
131
|
+
deliveryDelay,
|
|
132
|
+
messageRetentionPeriod
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
// TODO(Pookensivee): Make tests for this util
|
|
139
|
+
composeR2Arguments({
|
|
140
|
+
resourceName,
|
|
141
|
+
storageClass = "Standard"
|
|
142
|
+
}) {
|
|
143
|
+
return {
|
|
144
|
+
transform: {
|
|
145
|
+
bucket: {
|
|
146
|
+
name: resourceName,
|
|
147
|
+
jurisdiction: "eu",
|
|
148
|
+
location: "weur",
|
|
149
|
+
storageClass
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
}
|
|
148
154
|
// TODO: Solve the circular dependency on post infrastructure deploy script
|
|
149
155
|
// TODO: Cannot assign a queue as a producer, work around: https://developers.cloudflare.com/workers/wrangler/commands/#queues-consumer-add-script-name
|
|
150
156
|
// async composeWorkerArguments({
|
|
@@ -226,8 +232,8 @@ class Infrastructure {
|
|
|
226
232
|
kv(options) {
|
|
227
233
|
const { resourceName, bindingName } = options;
|
|
228
234
|
return new this.sst.cloudflare.Kv(
|
|
229
|
-
`${composeBindingName({ resource: "kv", resourceName, bindingName })}`,
|
|
230
|
-
composeKvArguments({
|
|
235
|
+
`${this.composeBindingName({ resource: "kv", resourceName, bindingName })}`,
|
|
236
|
+
this.composeKvArguments({
|
|
231
237
|
resourceName: this.composeResourceName({ resourceName })
|
|
232
238
|
})
|
|
233
239
|
);
|
|
@@ -238,8 +244,8 @@ class Infrastructure {
|
|
|
238
244
|
d1(options) {
|
|
239
245
|
const { resourceName, bindingName } = options;
|
|
240
246
|
return new this.sst.cloudflare.D1(
|
|
241
|
-
`${composeBindingName({ resource: "d1", resourceName, bindingName })}`,
|
|
242
|
-
composeD1Arguments({
|
|
247
|
+
`${this.composeBindingName({ resource: "d1", resourceName, bindingName })}`,
|
|
248
|
+
this.composeD1Arguments({
|
|
243
249
|
resourceName: this.composeResourceName({ resourceName })
|
|
244
250
|
})
|
|
245
251
|
);
|
|
@@ -250,8 +256,8 @@ class Infrastructure {
|
|
|
250
256
|
queue(options) {
|
|
251
257
|
const { resourceName, bindingName, deliveryDelay, messageRetentionPeriod } = options;
|
|
252
258
|
return new this.sst.cloudflare.Queue(
|
|
253
|
-
`${composeBindingName({ resource: "queue", resourceName, bindingName })}`,
|
|
254
|
-
composeQueueArguments({
|
|
259
|
+
`${this.composeBindingName({ resource: "queue", resourceName, bindingName })}`,
|
|
260
|
+
this.composeQueueArguments({
|
|
255
261
|
resourceName: this.composeResourceName({ resourceName }),
|
|
256
262
|
deliveryDelay,
|
|
257
263
|
messageRetentionPeriod
|
|
@@ -264,8 +270,8 @@ class Infrastructure {
|
|
|
264
270
|
r2(options) {
|
|
265
271
|
const { resourceName, bindingName, storageClass } = options;
|
|
266
272
|
return new this.sst.cloudflare.Bucket(
|
|
267
|
-
`${composeBindingName({ resource: "r2", resourceName, bindingName })}`,
|
|
268
|
-
composeR2Arguments({
|
|
273
|
+
`${this.composeBindingName({ resource: "r2", resourceName, bindingName })}`,
|
|
274
|
+
this.composeR2Arguments({
|
|
269
275
|
resourceName: this.composeResourceName({ resourceName }),
|
|
270
276
|
storageClass
|
|
271
277
|
})
|
|
@@ -508,7 +514,7 @@ const RPCResponse = {
|
|
|
508
514
|
* @returns An `IRPCResponse<T>` with `null` data and the provided error.
|
|
509
515
|
*/
|
|
510
516
|
serviceError(error) {
|
|
511
|
-
|
|
517
|
+
console.error(error.message);
|
|
512
518
|
return {
|
|
513
519
|
status: error.status,
|
|
514
520
|
message: error.message,
|
|
@@ -963,15 +969,15 @@ function develitWorker(Worker) {
|
|
|
963
969
|
}
|
|
964
970
|
|
|
965
971
|
exports.DatabaseTransaction = DatabaseTransaction;
|
|
966
|
-
exports.ENVIRONMENT = ENVIRONMENT;
|
|
967
972
|
exports.Infrastructure = Infrastructure;
|
|
968
973
|
exports.RPCResponse = RPCResponse;
|
|
969
974
|
exports.action = action;
|
|
975
|
+
exports.bankAccount = bankAccount;
|
|
976
|
+
exports.bankAccountPostgres = bankAccountPostgres;
|
|
970
977
|
exports.base = base;
|
|
971
978
|
exports.basePostgres = basePostgres;
|
|
972
979
|
exports.calculateExponentialBackoff = calculateExponentialBackoff;
|
|
973
980
|
exports.cloudflareQueue = cloudflareQueue;
|
|
974
|
-
exports.composeBindingName = composeBindingName;
|
|
975
981
|
exports.createAuditLogWriter = createAuditLogWriter;
|
|
976
982
|
exports.createInternalError = createInternalError;
|
|
977
983
|
exports.defineCommand = defineCommand;
|
|
@@ -998,4 +1004,3 @@ exports.swiftZodSchema = swiftZodSchema;
|
|
|
998
1004
|
exports.useResult = useResult;
|
|
999
1005
|
exports.useResultSync = useResultSync;
|
|
1000
1006
|
exports.uuidv4 = uuidv4;
|
|
1001
|
-
exports.validateEnvironment = validateEnvironment;
|
package/dist/index.d.cts
CHANGED
|
@@ -24,11 +24,285 @@ declare const basePostgres: {
|
|
|
24
24
|
deletedAt: drizzle_orm.HasDefault<drizzle_orm_pg_core.PgTimestampBuilderInitial<"deleted_at">>;
|
|
25
25
|
};
|
|
26
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
|
+
|
|
27
300
|
type Project = 'creditio' | 'fp' | 'mdm' | 'moneio' | 'txs';
|
|
28
301
|
|
|
302
|
+
type Resource = 'kv' | 'd1' | 'queue' | 'r2' | 'worker' | 'service' | 'orchestrator';
|
|
303
|
+
|
|
29
304
|
type Environment = number | 'dev' | 'test' | 'staging' | 'production';
|
|
30
305
|
|
|
31
|
-
declare const validateEnvironment: (environment: string) => Environment;
|
|
32
306
|
interface SstInstance {
|
|
33
307
|
cloudflare: {
|
|
34
308
|
[key: string]: any;
|
|
@@ -43,9 +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;
|
|
46
325
|
composeResourceName({ resourceName }: {
|
|
47
326
|
resourceName: string;
|
|
48
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
|
+
};
|
|
49
375
|
/**
|
|
50
376
|
* Creates an instance of Cloudflare KV.
|
|
51
377
|
*/
|
|
@@ -112,16 +438,6 @@ declare class Infrastructure {
|
|
|
112
438
|
}): any;
|
|
113
439
|
}
|
|
114
440
|
|
|
115
|
-
type Resource = 'kv' | 'd1' | 'queue' | 'r2' | 'worker' | 'service' | 'orchestrator';
|
|
116
|
-
|
|
117
|
-
declare const composeBindingName: ({ resource, resourceName, bindingName, }: {
|
|
118
|
-
resource: Resource;
|
|
119
|
-
resourceName: string;
|
|
120
|
-
bindingName?: string;
|
|
121
|
-
}) => string;
|
|
122
|
-
|
|
123
|
-
declare const ENVIRONMENT: string[];
|
|
124
|
-
|
|
125
441
|
type InternalErrorResponseStatus = Exclude<StatusCodes, 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207>;
|
|
126
442
|
interface InternalError {
|
|
127
443
|
status: InternalErrorResponseStatus;
|
|
@@ -504,5 +820,5 @@ interface WithRetryCounterOptions {
|
|
|
504
820
|
type AsyncMethod<TArgs extends unknown[] = unknown[], TResult = unknown> = (...args: TArgs) => Promise<TResult>;
|
|
505
821
|
declare function cloudflareQueue<TArgs extends unknown[] = unknown[], TResult = unknown>(options: WithRetryCounterOptions): (target: unknown, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<AsyncMethod<TArgs, TResult>>) => void;
|
|
506
822
|
|
|
507
|
-
export { DatabaseTransaction,
|
|
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 };
|
|
508
824
|
export type { ActionExecution, ActionHandlerOptions, AuditLogWriter, Command, CommandLogPayload, DevelitWorkerMethods, Environment, GatewayResponse, IRPCResponse, IncludeRelation, InferResultType, InternalError, InternalErrorResponseStatus, Project, ValidatedInput };
|