@develit-services/bank 0.0.16 → 0.0.17

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.
Files changed (31) hide show
  1. package/dist/database/schema.cjs +2 -1
  2. package/dist/database/schema.d.cts +1 -1
  3. package/dist/database/schema.d.mts +1 -1
  4. package/dist/database/schema.d.ts +1 -1
  5. package/dist/database/schema.mjs +1 -1
  6. package/dist/export/worker.cjs +102 -40
  7. package/dist/export/worker.d.cts +27 -12
  8. package/dist/export/worker.d.mts +27 -12
  9. package/dist/export/worker.d.ts +27 -12
  10. package/dist/export/worker.mjs +102 -40
  11. package/dist/export/wrangler.cjs +1 -1
  12. package/dist/export/wrangler.d.cts +2 -1
  13. package/dist/export/wrangler.d.mts +2 -1
  14. package/dist/export/wrangler.d.ts +2 -1
  15. package/dist/export/wrangler.mjs +1 -1
  16. package/dist/shared/{bank.DZS4d3MJ.mjs → bank.4vcryDK5.mjs} +103 -59
  17. package/dist/shared/{bank.BoVUuQ1D.d.mts → bank.BTiCct5w.d.ts} +18 -10
  18. package/dist/shared/{bank.BeH-ZCJJ.mjs → bank.Bgq67An_.mjs} +24 -1
  19. package/dist/shared/{bank.Ce58djRL.cjs → bank.C9Yr7ASx.cjs} +103 -59
  20. package/dist/shared/{bank.BT_Yf43j.d.cts → bank.CYP8KnoM.d.cts} +182 -7
  21. package/dist/shared/{bank.BT_Yf43j.d.mts → bank.CYP8KnoM.d.mts} +182 -7
  22. package/dist/shared/{bank.BT_Yf43j.d.ts → bank.CYP8KnoM.d.ts} +182 -7
  23. package/dist/shared/{bank.BwleO_ON.d.cts → bank.DkD_K2Pp.d.mts} +18 -10
  24. package/dist/shared/{bank.DlquvmPs.d.ts → bank.DnUXZU3A.d.cts} +18 -10
  25. package/dist/shared/{bank.CrAQe4PH.cjs → bank.Docz6If9.cjs} +26 -0
  26. package/dist/types.cjs +6 -4
  27. package/dist/types.d.cts +47 -15
  28. package/dist/types.d.mts +47 -15
  29. package/dist/types.d.ts +47 -15
  30. package/dist/types.mjs +4 -4
  31. package/package.json +1 -1
@@ -82,10 +82,10 @@ declare const paymentInsertTypeZod: z.ZodObject<{
82
82
  }>;
83
83
  status: z.ZodEnum<{
84
84
  PREPARED: "PREPARED";
85
- COMPLETED: "COMPLETED";
86
- FAILED: "FAILED";
87
85
  INITIALIZED: "INITIALIZED";
86
+ FAILED: "FAILED";
88
87
  PENDING: "PENDING";
88
+ COMPLETED: "COMPLETED";
89
89
  CREATED: "CREATED";
90
90
  }>;
91
91
  batchId: z.ZodString;
@@ -165,7 +165,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
165
165
  tableName: "batch";
166
166
  dataType: "string";
167
167
  columnType: "SQLiteText";
168
- data: "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | "PREPARED" | "COMPLETED" | "FAILED";
168
+ data: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN";
169
169
  driverParam: string;
170
170
  notNull: false;
171
171
  hasDefault: false;
@@ -178,7 +178,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
178
178
  generated: undefined;
179
179
  }, {}, {
180
180
  length: number | undefined;
181
- $type: "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | "PREPARED" | "COMPLETED" | "FAILED";
181
+ $type: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN";
182
182
  }>;
183
183
  payments: drizzle_orm_sqlite_core.SQLiteColumn<{
184
184
  name: "payments";
@@ -416,7 +416,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
416
416
  tableName: "payment";
417
417
  dataType: "string";
418
418
  columnType: "SQLiteText";
419
- data: "PREPARED" | "COMPLETED" | "FAILED" | "INITIALIZED" | "PENDING" | "CREATED";
419
+ data: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
420
420
  driverParam: string;
421
421
  notNull: true;
422
422
  hasDefault: false;
@@ -429,7 +429,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
429
429
  generated: undefined;
430
430
  }, {}, {
431
431
  length: number | undefined;
432
- $type: "PREPARED" | "COMPLETED" | "FAILED" | "INITIALIZED" | "PENDING" | "CREATED";
432
+ $type: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
433
433
  }>;
434
434
  statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
435
435
  name: "status_reason";
@@ -770,12 +770,187 @@ declare const paymentRelations: drizzle_orm.Relations<"payment", {
770
770
  batch: drizzle_orm.One<"batch", false>;
771
771
  }>;
772
772
 
773
+ declare const ott: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
774
+ name: "otp";
775
+ schema: undefined;
776
+ columns: {
777
+ oneTimeToken: drizzle_orm_sqlite_core.SQLiteColumn<{
778
+ name: "one_time_token";
779
+ tableName: "otp";
780
+ dataType: "string";
781
+ columnType: "SQLiteText";
782
+ data: string;
783
+ driverParam: string;
784
+ notNull: true;
785
+ hasDefault: false;
786
+ isPrimaryKey: false;
787
+ isAutoincrement: false;
788
+ hasRuntimeDefault: false;
789
+ enumValues: [string, ...string[]];
790
+ baseColumn: never;
791
+ identity: undefined;
792
+ generated: undefined;
793
+ }, {}, {
794
+ length: number | undefined;
795
+ }>;
796
+ tokenType: drizzle_orm_sqlite_core.SQLiteColumn<{
797
+ name: "token_type";
798
+ tableName: "otp";
799
+ dataType: "string";
800
+ columnType: "SQLiteText";
801
+ data: "ACCOUNT_AUTHORIZATION";
802
+ driverParam: string;
803
+ notNull: true;
804
+ hasDefault: false;
805
+ isPrimaryKey: false;
806
+ isAutoincrement: false;
807
+ hasRuntimeDefault: false;
808
+ enumValues: ["ACCOUNT_AUTHORIZATION"];
809
+ baseColumn: never;
810
+ identity: undefined;
811
+ generated: undefined;
812
+ }, {}, {
813
+ length: number | undefined;
814
+ $type: "ACCOUNT_AUTHORIZATION";
815
+ }>;
816
+ connectorKey: drizzle_orm_sqlite_core.SQLiteColumn<{
817
+ name: "connector_key";
818
+ tableName: "otp";
819
+ dataType: "string";
820
+ columnType: "SQLiteText";
821
+ data: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA";
822
+ driverParam: string;
823
+ notNull: true;
824
+ hasDefault: false;
825
+ isPrimaryKey: false;
826
+ isAutoincrement: false;
827
+ hasRuntimeDefault: false;
828
+ enumValues: ["ERSTE", "FINBRICKS", "MOCK", "CREDITAS", "MOCK_COBS", "FIO", "MONETA"];
829
+ baseColumn: never;
830
+ identity: undefined;
831
+ generated: undefined;
832
+ }, {}, {
833
+ length: number | undefined;
834
+ $type: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA";
835
+ }>;
836
+ accountId: drizzle_orm_sqlite_core.SQLiteColumn<{
837
+ name: "account_id";
838
+ tableName: "otp";
839
+ dataType: "string";
840
+ columnType: "SQLiteText";
841
+ data: string;
842
+ driverParam: string;
843
+ notNull: true;
844
+ hasDefault: false;
845
+ isPrimaryKey: false;
846
+ isAutoincrement: false;
847
+ hasRuntimeDefault: false;
848
+ enumValues: [string, ...string[]];
849
+ baseColumn: never;
850
+ identity: undefined;
851
+ generated: undefined;
852
+ }, {}, {
853
+ length: number | undefined;
854
+ }>;
855
+ expiresAt: drizzle_orm_sqlite_core.SQLiteColumn<{
856
+ name: "expires_at";
857
+ tableName: "otp";
858
+ dataType: "date";
859
+ columnType: "SQLiteTimestamp";
860
+ data: Date;
861
+ driverParam: number;
862
+ notNull: true;
863
+ hasDefault: false;
864
+ isPrimaryKey: false;
865
+ isAutoincrement: false;
866
+ hasRuntimeDefault: false;
867
+ enumValues: undefined;
868
+ baseColumn: never;
869
+ identity: undefined;
870
+ generated: undefined;
871
+ }, {}, {}>;
872
+ id: drizzle_orm_sqlite_core.SQLiteColumn<{
873
+ name: "id";
874
+ tableName: "otp";
875
+ dataType: "string";
876
+ columnType: "SQLiteText";
877
+ data: string;
878
+ driverParam: string;
879
+ notNull: true;
880
+ hasDefault: false;
881
+ isPrimaryKey: true;
882
+ isAutoincrement: false;
883
+ hasRuntimeDefault: false;
884
+ enumValues: [string, ...string[]];
885
+ baseColumn: never;
886
+ identity: undefined;
887
+ generated: undefined;
888
+ }, {}, {
889
+ length: number | undefined;
890
+ }>;
891
+ createdAt: drizzle_orm_sqlite_core.SQLiteColumn<{
892
+ name: "created_at";
893
+ tableName: "otp";
894
+ dataType: "date";
895
+ columnType: "SQLiteTimestamp";
896
+ data: Date;
897
+ driverParam: number;
898
+ notNull: false;
899
+ hasDefault: true;
900
+ isPrimaryKey: false;
901
+ isAutoincrement: false;
902
+ hasRuntimeDefault: false;
903
+ enumValues: undefined;
904
+ baseColumn: never;
905
+ identity: undefined;
906
+ generated: undefined;
907
+ }, {}, {}>;
908
+ updatedAt: drizzle_orm_sqlite_core.SQLiteColumn<{
909
+ name: "updated_at";
910
+ tableName: "otp";
911
+ dataType: "date";
912
+ columnType: "SQLiteTimestamp";
913
+ data: Date;
914
+ driverParam: number;
915
+ notNull: false;
916
+ hasDefault: true;
917
+ isPrimaryKey: false;
918
+ isAutoincrement: false;
919
+ hasRuntimeDefault: false;
920
+ enumValues: undefined;
921
+ baseColumn: never;
922
+ identity: undefined;
923
+ generated: undefined;
924
+ }, {}, {}>;
925
+ deletedAt: drizzle_orm_sqlite_core.SQLiteColumn<{
926
+ name: "deleted_at";
927
+ tableName: "otp";
928
+ dataType: "date";
929
+ columnType: "SQLiteTimestamp";
930
+ data: Date;
931
+ driverParam: number;
932
+ notNull: false;
933
+ hasDefault: true;
934
+ isPrimaryKey: false;
935
+ isAutoincrement: false;
936
+ hasRuntimeDefault: false;
937
+ enumValues: undefined;
938
+ baseColumn: never;
939
+ identity: undefined;
940
+ generated: undefined;
941
+ }, {}, {}>;
942
+ };
943
+ dialect: "sqlite";
944
+ }>;
945
+
773
946
  declare const schema_batch: typeof batch;
947
+ declare const schema_ott: typeof ott;
774
948
  declare const schema_payment: typeof payment;
775
949
  declare const schema_paymentRelations: typeof paymentRelations;
776
950
  declare namespace schema {
777
951
  export {
778
952
  schema_batch as batch,
953
+ schema_ott as ott,
779
954
  schema_payment as payment,
780
955
  schema_paymentRelations as paymentRelations,
781
956
  };
@@ -783,5 +958,5 @@ declare namespace schema {
783
958
 
784
959
  declare const tables: typeof schema;
785
960
 
786
- export { batch as c, payment as d, paymentRelations as e, paymentInsertTypeZod as p, tables as t };
961
+ export { batch as c, payment as d, paymentRelations as e, ott as o, paymentInsertTypeZod as p, tables as t };
787
962
  export type { BatchSelectType as B, PaymentSelectType as P, PaymentInsertType as a, BatchInsertType as b };
@@ -82,10 +82,10 @@ declare const paymentInsertTypeZod: z.ZodObject<{
82
82
  }>;
83
83
  status: z.ZodEnum<{
84
84
  PREPARED: "PREPARED";
85
- COMPLETED: "COMPLETED";
86
- FAILED: "FAILED";
87
85
  INITIALIZED: "INITIALIZED";
86
+ FAILED: "FAILED";
88
87
  PENDING: "PENDING";
88
+ COMPLETED: "COMPLETED";
89
89
  CREATED: "CREATED";
90
90
  }>;
91
91
  batchId: z.ZodString;
@@ -165,7 +165,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
165
165
  tableName: "batch";
166
166
  dataType: "string";
167
167
  columnType: "SQLiteText";
168
- data: "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | "PREPARED" | "COMPLETED" | "FAILED";
168
+ data: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN";
169
169
  driverParam: string;
170
170
  notNull: false;
171
171
  hasDefault: false;
@@ -178,7 +178,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
178
178
  generated: undefined;
179
179
  }, {}, {
180
180
  length: number | undefined;
181
- $type: "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | "PREPARED" | "COMPLETED" | "FAILED";
181
+ $type: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN";
182
182
  }>;
183
183
  payments: drizzle_orm_sqlite_core.SQLiteColumn<{
184
184
  name: "payments";
@@ -416,7 +416,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
416
416
  tableName: "payment";
417
417
  dataType: "string";
418
418
  columnType: "SQLiteText";
419
- data: "PREPARED" | "COMPLETED" | "FAILED" | "INITIALIZED" | "PENDING" | "CREATED";
419
+ data: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
420
420
  driverParam: string;
421
421
  notNull: true;
422
422
  hasDefault: false;
@@ -429,7 +429,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
429
429
  generated: undefined;
430
430
  }, {}, {
431
431
  length: number | undefined;
432
- $type: "PREPARED" | "COMPLETED" | "FAILED" | "INITIALIZED" | "PENDING" | "CREATED";
432
+ $type: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
433
433
  }>;
434
434
  statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
435
435
  name: "status_reason";
@@ -770,12 +770,187 @@ declare const paymentRelations: drizzle_orm.Relations<"payment", {
770
770
  batch: drizzle_orm.One<"batch", false>;
771
771
  }>;
772
772
 
773
+ declare const ott: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
774
+ name: "otp";
775
+ schema: undefined;
776
+ columns: {
777
+ oneTimeToken: drizzle_orm_sqlite_core.SQLiteColumn<{
778
+ name: "one_time_token";
779
+ tableName: "otp";
780
+ dataType: "string";
781
+ columnType: "SQLiteText";
782
+ data: string;
783
+ driverParam: string;
784
+ notNull: true;
785
+ hasDefault: false;
786
+ isPrimaryKey: false;
787
+ isAutoincrement: false;
788
+ hasRuntimeDefault: false;
789
+ enumValues: [string, ...string[]];
790
+ baseColumn: never;
791
+ identity: undefined;
792
+ generated: undefined;
793
+ }, {}, {
794
+ length: number | undefined;
795
+ }>;
796
+ tokenType: drizzle_orm_sqlite_core.SQLiteColumn<{
797
+ name: "token_type";
798
+ tableName: "otp";
799
+ dataType: "string";
800
+ columnType: "SQLiteText";
801
+ data: "ACCOUNT_AUTHORIZATION";
802
+ driverParam: string;
803
+ notNull: true;
804
+ hasDefault: false;
805
+ isPrimaryKey: false;
806
+ isAutoincrement: false;
807
+ hasRuntimeDefault: false;
808
+ enumValues: ["ACCOUNT_AUTHORIZATION"];
809
+ baseColumn: never;
810
+ identity: undefined;
811
+ generated: undefined;
812
+ }, {}, {
813
+ length: number | undefined;
814
+ $type: "ACCOUNT_AUTHORIZATION";
815
+ }>;
816
+ connectorKey: drizzle_orm_sqlite_core.SQLiteColumn<{
817
+ name: "connector_key";
818
+ tableName: "otp";
819
+ dataType: "string";
820
+ columnType: "SQLiteText";
821
+ data: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA";
822
+ driverParam: string;
823
+ notNull: true;
824
+ hasDefault: false;
825
+ isPrimaryKey: false;
826
+ isAutoincrement: false;
827
+ hasRuntimeDefault: false;
828
+ enumValues: ["ERSTE", "FINBRICKS", "MOCK", "CREDITAS", "MOCK_COBS", "FIO", "MONETA"];
829
+ baseColumn: never;
830
+ identity: undefined;
831
+ generated: undefined;
832
+ }, {}, {
833
+ length: number | undefined;
834
+ $type: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA";
835
+ }>;
836
+ accountId: drizzle_orm_sqlite_core.SQLiteColumn<{
837
+ name: "account_id";
838
+ tableName: "otp";
839
+ dataType: "string";
840
+ columnType: "SQLiteText";
841
+ data: string;
842
+ driverParam: string;
843
+ notNull: true;
844
+ hasDefault: false;
845
+ isPrimaryKey: false;
846
+ isAutoincrement: false;
847
+ hasRuntimeDefault: false;
848
+ enumValues: [string, ...string[]];
849
+ baseColumn: never;
850
+ identity: undefined;
851
+ generated: undefined;
852
+ }, {}, {
853
+ length: number | undefined;
854
+ }>;
855
+ expiresAt: drizzle_orm_sqlite_core.SQLiteColumn<{
856
+ name: "expires_at";
857
+ tableName: "otp";
858
+ dataType: "date";
859
+ columnType: "SQLiteTimestamp";
860
+ data: Date;
861
+ driverParam: number;
862
+ notNull: true;
863
+ hasDefault: false;
864
+ isPrimaryKey: false;
865
+ isAutoincrement: false;
866
+ hasRuntimeDefault: false;
867
+ enumValues: undefined;
868
+ baseColumn: never;
869
+ identity: undefined;
870
+ generated: undefined;
871
+ }, {}, {}>;
872
+ id: drizzle_orm_sqlite_core.SQLiteColumn<{
873
+ name: "id";
874
+ tableName: "otp";
875
+ dataType: "string";
876
+ columnType: "SQLiteText";
877
+ data: string;
878
+ driverParam: string;
879
+ notNull: true;
880
+ hasDefault: false;
881
+ isPrimaryKey: true;
882
+ isAutoincrement: false;
883
+ hasRuntimeDefault: false;
884
+ enumValues: [string, ...string[]];
885
+ baseColumn: never;
886
+ identity: undefined;
887
+ generated: undefined;
888
+ }, {}, {
889
+ length: number | undefined;
890
+ }>;
891
+ createdAt: drizzle_orm_sqlite_core.SQLiteColumn<{
892
+ name: "created_at";
893
+ tableName: "otp";
894
+ dataType: "date";
895
+ columnType: "SQLiteTimestamp";
896
+ data: Date;
897
+ driverParam: number;
898
+ notNull: false;
899
+ hasDefault: true;
900
+ isPrimaryKey: false;
901
+ isAutoincrement: false;
902
+ hasRuntimeDefault: false;
903
+ enumValues: undefined;
904
+ baseColumn: never;
905
+ identity: undefined;
906
+ generated: undefined;
907
+ }, {}, {}>;
908
+ updatedAt: drizzle_orm_sqlite_core.SQLiteColumn<{
909
+ name: "updated_at";
910
+ tableName: "otp";
911
+ dataType: "date";
912
+ columnType: "SQLiteTimestamp";
913
+ data: Date;
914
+ driverParam: number;
915
+ notNull: false;
916
+ hasDefault: true;
917
+ isPrimaryKey: false;
918
+ isAutoincrement: false;
919
+ hasRuntimeDefault: false;
920
+ enumValues: undefined;
921
+ baseColumn: never;
922
+ identity: undefined;
923
+ generated: undefined;
924
+ }, {}, {}>;
925
+ deletedAt: drizzle_orm_sqlite_core.SQLiteColumn<{
926
+ name: "deleted_at";
927
+ tableName: "otp";
928
+ dataType: "date";
929
+ columnType: "SQLiteTimestamp";
930
+ data: Date;
931
+ driverParam: number;
932
+ notNull: false;
933
+ hasDefault: true;
934
+ isPrimaryKey: false;
935
+ isAutoincrement: false;
936
+ hasRuntimeDefault: false;
937
+ enumValues: undefined;
938
+ baseColumn: never;
939
+ identity: undefined;
940
+ generated: undefined;
941
+ }, {}, {}>;
942
+ };
943
+ dialect: "sqlite";
944
+ }>;
945
+
773
946
  declare const schema_batch: typeof batch;
947
+ declare const schema_ott: typeof ott;
774
948
  declare const schema_payment: typeof payment;
775
949
  declare const schema_paymentRelations: typeof paymentRelations;
776
950
  declare namespace schema {
777
951
  export {
778
952
  schema_batch as batch,
953
+ schema_ott as ott,
779
954
  schema_payment as payment,
780
955
  schema_paymentRelations as paymentRelations,
781
956
  };
@@ -783,5 +958,5 @@ declare namespace schema {
783
958
 
784
959
  declare const tables: typeof schema;
785
960
 
786
- export { batch as c, payment as d, paymentRelations as e, paymentInsertTypeZod as p, tables as t };
961
+ export { batch as c, payment as d, paymentRelations as e, ott as o, paymentInsertTypeZod as p, tables as t };
787
962
  export type { BatchSelectType as B, PaymentSelectType as P, PaymentInsertType as a, BatchInsertType as b };
@@ -1,6 +1,6 @@
1
1
  import { Environment } from '@develit-io/backend-sdk';
2
2
  import { BANK_CODES, CURRENCY_CODES, CODES } from '@develit-io/general-codes';
3
- import { a as PaymentInsertType, t as tables } from './bank.BT_Yf43j.cjs';
3
+ import { a as PaymentInsertType, t as tables } from './bank.CYP8KnoM.mjs';
4
4
  import { DrizzleD1Database } from 'drizzle-orm/d1';
5
5
 
6
6
  declare const PAYMENT_TYPES: readonly ["SEPA", "SWIFT", "IFSC", "DOMESTIC"];
@@ -28,7 +28,10 @@ type CountryCode = (typeof COUNTRY_CODES)[number];
28
28
  interface BankAccountWithLastSync extends ConfigBankAccount {
29
29
  lastSyncAt: SyncLog;
30
30
  }
31
- type ConnectorKey = 'ERSTE' | 'FINBRICKS' | 'MOCK' | 'CREDITAS' | 'MOCK_COBS' | 'FIO' | 'MONETA';
31
+ declare const CONNECTOR_KEYS: readonly ["ERSTE", "FINBRICKS", "MOCK", "CREDITAS", "MOCK_COBS", "FIO", "MONETA"];
32
+ type ConnectorKey = (typeof CONNECTOR_KEYS)[number];
33
+ declare const TOKEN_TYPES: readonly ["ACCOUNT_AUTHORIZATION"];
34
+ type TokenType = (typeof TOKEN_TYPES)[number];
32
35
  interface ConfigBankAccount {
33
36
  connectorKey: ConnectorKey;
34
37
  id: string;
@@ -77,14 +80,19 @@ type AuthInput = {
77
80
  token: string;
78
81
  refreshToken?: string;
79
82
  };
80
- type AccountConnection = {
81
- clientId: string;
82
- redirectUrl: string;
83
- };
84
83
  declare abstract class IBankConnector {
85
84
  abstract connectorKey: ConnectorKey;
86
- abstract authenticate(code: AuthInput): Promise<string>;
87
- abstract connectUserAccount(): Promise<AccountConnection>;
85
+ abstract kv: KVNamespace;
86
+ abstract authenticate(tokens?: {
87
+ refreshToken?: string;
88
+ }): Promise<string>;
89
+ abstract getAuthUri({ accountId, ott, }: {
90
+ accountId: string;
91
+ ott: string;
92
+ }): Promise<string>;
93
+ abstract authorizeAccount({ urlParams, }: {
94
+ urlParams: string;
95
+ }): Promise<boolean>;
88
96
  abstract listAccounts(): Promise<[]>;
89
97
  abstract preparePayment(payment: IncomingPaymentMessage): Promise<PaymentPreparedInsertType>;
90
98
  abstract initiateBatchFromPayments({ payments, }: {
@@ -110,5 +118,5 @@ interface IncomingPaymentMessage extends PaymentInsertType {
110
118
  interface OutgoingPaymentMessage extends PaymentInsertType {
111
119
  }
112
120
 
113
- export { IBankConnector as I, BATCH_STATUSES as o, PAYMENT_TYPES as q, PAYMENT_STATUSES as s, PAYMENT_DIRECTIONS as t, COUNTRY_CODES as v };
114
- export type { AccountConnection as A, BankAccountWithLastSync as B, ConfigEnvironmentBankAccount as C, OutgoingPaymentMessage as O, PaymentPreparedInsertType as P, SyncLog as S, ConfigBankAccount as a, ConnectorKey as b, CurrencyCode as c, BankCode as d, CountryCode as e, AuthInput as f, IncomingPaymentMessage as g, InitiatedBatch as h, InitiatedPayment as i, PaymentStatus as j, BatchStatus as k, BatchMetadata as l, Currency as m, PaymentFailedInsertType as n, paymentInitializedInsertType as p, PaymentType as r, PaymentDirection as u };
121
+ export { IBankConnector as I, TOKEN_TYPES as T, BATCH_STATUSES as n, PAYMENT_TYPES as o, PAYMENT_STATUSES as r, PAYMENT_DIRECTIONS as s, COUNTRY_CODES as u, CONNECTOR_KEYS as v };
122
+ export type { AuthInput as A, BankAccountWithLastSync as B, ConfigEnvironmentBankAccount as C, OutgoingPaymentMessage as O, PaymentPreparedInsertType as P, SyncLog as S, ConfigBankAccount as a, ConnectorKey as b, CurrencyCode as c, BankCode as d, CountryCode as e, IncomingPaymentMessage as f, InitiatedBatch as g, InitiatedPayment as h, PaymentStatus as i, BatchStatus as j, BatchMetadata as k, Currency as l, PaymentFailedInsertType as m, paymentInitializedInsertType as p, PaymentType as q, PaymentDirection as t, TokenType as w };
@@ -1,6 +1,6 @@
1
1
  import { Environment } from '@develit-io/backend-sdk';
2
2
  import { BANK_CODES, CURRENCY_CODES, CODES } from '@develit-io/general-codes';
3
- import { a as PaymentInsertType, t as tables } from './bank.BT_Yf43j.js';
3
+ import { a as PaymentInsertType, t as tables } from './bank.CYP8KnoM.cjs';
4
4
  import { DrizzleD1Database } from 'drizzle-orm/d1';
5
5
 
6
6
  declare const PAYMENT_TYPES: readonly ["SEPA", "SWIFT", "IFSC", "DOMESTIC"];
@@ -28,7 +28,10 @@ type CountryCode = (typeof COUNTRY_CODES)[number];
28
28
  interface BankAccountWithLastSync extends ConfigBankAccount {
29
29
  lastSyncAt: SyncLog;
30
30
  }
31
- type ConnectorKey = 'ERSTE' | 'FINBRICKS' | 'MOCK' | 'CREDITAS' | 'MOCK_COBS' | 'FIO' | 'MONETA';
31
+ declare const CONNECTOR_KEYS: readonly ["ERSTE", "FINBRICKS", "MOCK", "CREDITAS", "MOCK_COBS", "FIO", "MONETA"];
32
+ type ConnectorKey = (typeof CONNECTOR_KEYS)[number];
33
+ declare const TOKEN_TYPES: readonly ["ACCOUNT_AUTHORIZATION"];
34
+ type TokenType = (typeof TOKEN_TYPES)[number];
32
35
  interface ConfigBankAccount {
33
36
  connectorKey: ConnectorKey;
34
37
  id: string;
@@ -77,14 +80,19 @@ type AuthInput = {
77
80
  token: string;
78
81
  refreshToken?: string;
79
82
  };
80
- type AccountConnection = {
81
- clientId: string;
82
- redirectUrl: string;
83
- };
84
83
  declare abstract class IBankConnector {
85
84
  abstract connectorKey: ConnectorKey;
86
- abstract authenticate(code: AuthInput): Promise<string>;
87
- abstract connectUserAccount(): Promise<AccountConnection>;
85
+ abstract kv: KVNamespace;
86
+ abstract authenticate(tokens?: {
87
+ refreshToken?: string;
88
+ }): Promise<string>;
89
+ abstract getAuthUri({ accountId, ott, }: {
90
+ accountId: string;
91
+ ott: string;
92
+ }): Promise<string>;
93
+ abstract authorizeAccount({ urlParams, }: {
94
+ urlParams: string;
95
+ }): Promise<boolean>;
88
96
  abstract listAccounts(): Promise<[]>;
89
97
  abstract preparePayment(payment: IncomingPaymentMessage): Promise<PaymentPreparedInsertType>;
90
98
  abstract initiateBatchFromPayments({ payments, }: {
@@ -110,5 +118,5 @@ interface IncomingPaymentMessage extends PaymentInsertType {
110
118
  interface OutgoingPaymentMessage extends PaymentInsertType {
111
119
  }
112
120
 
113
- export { IBankConnector as I, BATCH_STATUSES as o, PAYMENT_TYPES as q, PAYMENT_STATUSES as s, PAYMENT_DIRECTIONS as t, COUNTRY_CODES as v };
114
- export type { AccountConnection as A, BankAccountWithLastSync as B, ConfigEnvironmentBankAccount as C, OutgoingPaymentMessage as O, PaymentPreparedInsertType as P, SyncLog as S, ConfigBankAccount as a, ConnectorKey as b, CurrencyCode as c, BankCode as d, CountryCode as e, AuthInput as f, IncomingPaymentMessage as g, InitiatedBatch as h, InitiatedPayment as i, PaymentStatus as j, BatchStatus as k, BatchMetadata as l, Currency as m, PaymentFailedInsertType as n, paymentInitializedInsertType as p, PaymentType as r, PaymentDirection as u };
121
+ export { IBankConnector as I, TOKEN_TYPES as T, BATCH_STATUSES as n, PAYMENT_TYPES as o, PAYMENT_STATUSES as r, PAYMENT_DIRECTIONS as s, COUNTRY_CODES as u, CONNECTOR_KEYS as v };
122
+ export type { AuthInput as A, BankAccountWithLastSync as B, ConfigEnvironmentBankAccount as C, OutgoingPaymentMessage as O, PaymentPreparedInsertType as P, SyncLog as S, ConfigBankAccount as a, ConnectorKey as b, CurrencyCode as c, BankCode as d, CountryCode as e, IncomingPaymentMessage as f, InitiatedBatch as g, InitiatedPayment as h, PaymentStatus as i, BatchStatus as j, BatchMetadata as k, Currency as l, PaymentFailedInsertType as m, paymentInitializedInsertType as p, PaymentType as q, PaymentDirection as t, TokenType as w };
@@ -59,14 +59,40 @@ const paymentRelations = relations.relations(payment, ({ one }) => ({
59
59
  batch: one(batch, { fields: [payment.batchId], references: [batch.id] })
60
60
  }));
61
61
 
62
+ const CONNECTOR_KEYS = [
63
+ "ERSTE",
64
+ "FINBRICKS",
65
+ "MOCK",
66
+ "CREDITAS",
67
+ "MOCK_COBS",
68
+ "FIO",
69
+ "MONETA"
70
+ ];
71
+ const TOKEN_TYPES = ["ACCOUNT_AUTHORIZATION"];
72
+
73
+ const ott = sqliteCore.sqliteTable("otp", {
74
+ ...backendSdk.base,
75
+ oneTimeToken: sqliteCore.text("one_time_token").notNull(),
76
+ tokenType: sqliteCore.text("token_type", { enum: TOKEN_TYPES }).$type().notNull(),
77
+ connectorKey: sqliteCore.text("connector_key", {
78
+ enum: CONNECTOR_KEYS
79
+ }).$type().notNull(),
80
+ accountId: sqliteCore.text("account_id").notNull(),
81
+ expiresAt: sqliteCore.integer("expires_at", { mode: "timestamp_ms" }).notNull()
82
+ });
83
+
62
84
  const schema = {
63
85
  __proto__: null,
64
86
  batch: batch,
87
+ ott: ott,
65
88
  payment: payment,
66
89
  paymentRelations: paymentRelations
67
90
  };
68
91
 
92
+ exports.CONNECTOR_KEYS = CONNECTOR_KEYS;
93
+ exports.TOKEN_TYPES = TOKEN_TYPES;
69
94
  exports.batch = batch;
95
+ exports.ott = ott;
70
96
  exports.payment = payment;
71
97
  exports.paymentRelations = paymentRelations;
72
98
  exports.schema = schema;
package/dist/types.cjs CHANGED
@@ -1,16 +1,16 @@
1
1
  'use strict';
2
2
 
3
- const db = require('./shared/bank.Ce58djRL.cjs');
3
+ const db = require('./shared/bank.C9Yr7ASx.cjs');
4
+ const database_schema = require('./shared/bank.Docz6If9.cjs');
4
5
  const generalCodes = require('@develit-io/general-codes');
5
6
  require('@develit-io/backend-sdk');
6
- require('./shared/bank.CrAQe4PH.cjs');
7
- require('drizzle-orm/sqlite-core');
8
- require('drizzle-orm/relations');
9
7
  require('drizzle-orm');
10
8
  require('zod');
11
9
  require('jose');
12
10
  require('superjson');
13
11
  require('date-fns');
12
+ require('drizzle-orm/sqlite-core');
13
+ require('drizzle-orm/relations');
14
14
 
15
15
 
16
16
 
@@ -30,5 +30,7 @@ exports.PAYMENT_TYPES = db.PAYMENT_TYPES;
30
30
  exports.paymentInsertTypeZod = db.paymentInsertTypeZod;
31
31
  exports.signFinbricksJws = db.signFinbricksJws;
32
32
  exports.useFinbricksFetch = db.useFinbricksFetch;
33
+ exports.CONNECTOR_KEYS = database_schema.CONNECTOR_KEYS;
34
+ exports.TOKEN_TYPES = database_schema.TOKEN_TYPES;
33
35
  exports.BANK_CODES = generalCodes.BANK_CODES;
34
36
  exports.CURRENCY_CODES = generalCodes.CURRENCY_CODES;