@develit-services/bank 0.3.48 → 0.3.50

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.
@@ -407,10 +407,8 @@ const updateAccountInputSchema = zod.z.object({
407
407
  });
408
408
 
409
409
  const getBankAccountsInputSchema = zod.z.object({
410
- includes: zod.z.object({
411
- workflow: zod.z.boolean().optional(),
412
- batchCounts: zod.z.boolean().optional()
413
- }).optional()
410
+ includeWorkflow: zod.z.boolean().optional(),
411
+ includeBatchCounts: zod.z.boolean().optional()
414
412
  });
415
413
 
416
414
  const disconnectAccountInputSchema = zod.z.object({
@@ -1013,13 +1011,15 @@ let BankServiceBase = class extends backendSdk.develitWorker(cloudflare_workers.
1013
1011
  return this.handleAction(
1014
1012
  { data: input, schema: getBankAccountsInputSchema },
1015
1013
  { successMessage: "Bank accounts retrieved successfully" },
1016
- async ({ includes }) => {
1014
+ async ({ includeWorkflow, includeBatchCounts }) => {
1017
1015
  const accounts = await this._getAccounts();
1018
- const includeWorkflow = includes?.workflow ?? true;
1019
- const includeBatchCounts = includes?.batchCounts ?? false;
1020
1016
  const accountsWithOptionalFields = await Promise.all(
1021
1017
  accounts.map(async (a) => {
1022
- const result = { ...a };
1018
+ const result = {
1019
+ ...a,
1020
+ workflow: null,
1021
+ batches: null
1022
+ };
1023
1023
  if (includeWorkflow) {
1024
1024
  let status;
1025
1025
  try {
@@ -2395,10 +2395,8 @@ type UpdateAccountInput = z.infer<typeof updateAccountInputSchema>;
2395
2395
  type UpdateAccountOutput = AccountSelectType;
2396
2396
 
2397
2397
  declare const getBankAccountsInputSchema: z.ZodObject<{
2398
- includes: z.ZodOptional<z.ZodObject<{
2399
- workflow: z.ZodOptional<z.ZodBoolean>;
2400
- batchCounts: z.ZodOptional<z.ZodBoolean>;
2401
- }, z.core.$strip>>;
2398
+ includeWorkflow: z.ZodOptional<z.ZodBoolean>;
2399
+ includeBatchCounts: z.ZodOptional<z.ZodBoolean>;
2402
2400
  }, z.core.$strip>;
2403
2401
  type GetBankAccountsInput = z.infer<typeof getBankAccountsInputSchema>;
2404
2402
  type WorkflowInfo = {
@@ -2410,10 +2408,10 @@ type BatchCounts = {
2410
2408
  openCount: number;
2411
2409
  readyToSignCount: number;
2412
2410
  failedCount: number;
2413
- };
2411
+ } | null;
2414
2412
  type AccountWithOptionalFields = AccountSelectType & {
2415
- workflow?: WorkflowInfo;
2416
- batches?: BatchCounts;
2413
+ workflow: WorkflowInfo;
2414
+ batches: BatchCounts;
2417
2415
  };
2418
2416
  type GetBankAccountsOutput = {
2419
2417
  accounts: AccountWithOptionalFields[];
@@ -2512,14 +2510,14 @@ declare class BankServiceBase extends BankServiceBase_base {
2512
2510
  addPaymentsToBatch({ paymentsToBatch, }: {
2513
2511
  paymentsToBatch: SendPaymentInput[];
2514
2512
  }): Promise<IRPCResponse<{
2513
+ status: "FAILED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED" | null;
2515
2514
  id: string;
2516
2515
  createdAt: Date | null;
2517
2516
  updatedAt: Date | null;
2518
2517
  deletedAt: Date | null;
2518
+ accountId: string | null;
2519
2519
  batchPaymentInitiatedAt: Date | null;
2520
2520
  authorizationUrls: string[] | null;
2521
- status: "FAILED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED" | null;
2522
- accountId: string | null;
2523
2521
  statusReason: string | null;
2524
2522
  payments: PaymentInsertType[];
2525
2523
  metadata: BatchMetadata | null;
@@ -2395,10 +2395,8 @@ type UpdateAccountInput = z.infer<typeof updateAccountInputSchema>;
2395
2395
  type UpdateAccountOutput = AccountSelectType;
2396
2396
 
2397
2397
  declare const getBankAccountsInputSchema: z.ZodObject<{
2398
- includes: z.ZodOptional<z.ZodObject<{
2399
- workflow: z.ZodOptional<z.ZodBoolean>;
2400
- batchCounts: z.ZodOptional<z.ZodBoolean>;
2401
- }, z.core.$strip>>;
2398
+ includeWorkflow: z.ZodOptional<z.ZodBoolean>;
2399
+ includeBatchCounts: z.ZodOptional<z.ZodBoolean>;
2402
2400
  }, z.core.$strip>;
2403
2401
  type GetBankAccountsInput = z.infer<typeof getBankAccountsInputSchema>;
2404
2402
  type WorkflowInfo = {
@@ -2410,10 +2408,10 @@ type BatchCounts = {
2410
2408
  openCount: number;
2411
2409
  readyToSignCount: number;
2412
2410
  failedCount: number;
2413
- };
2411
+ } | null;
2414
2412
  type AccountWithOptionalFields = AccountSelectType & {
2415
- workflow?: WorkflowInfo;
2416
- batches?: BatchCounts;
2413
+ workflow: WorkflowInfo;
2414
+ batches: BatchCounts;
2417
2415
  };
2418
2416
  type GetBankAccountsOutput = {
2419
2417
  accounts: AccountWithOptionalFields[];
@@ -2512,14 +2510,14 @@ declare class BankServiceBase extends BankServiceBase_base {
2512
2510
  addPaymentsToBatch({ paymentsToBatch, }: {
2513
2511
  paymentsToBatch: SendPaymentInput[];
2514
2512
  }): Promise<IRPCResponse<{
2513
+ status: "FAILED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED" | null;
2515
2514
  id: string;
2516
2515
  createdAt: Date | null;
2517
2516
  updatedAt: Date | null;
2518
2517
  deletedAt: Date | null;
2518
+ accountId: string | null;
2519
2519
  batchPaymentInitiatedAt: Date | null;
2520
2520
  authorizationUrls: string[] | null;
2521
- status: "FAILED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED" | null;
2522
- accountId: string | null;
2523
2521
  statusReason: string | null;
2524
2522
  payments: PaymentInsertType[];
2525
2523
  metadata: BatchMetadata | null;
@@ -2395,10 +2395,8 @@ type UpdateAccountInput = z.infer<typeof updateAccountInputSchema>;
2395
2395
  type UpdateAccountOutput = AccountSelectType;
2396
2396
 
2397
2397
  declare const getBankAccountsInputSchema: z.ZodObject<{
2398
- includes: z.ZodOptional<z.ZodObject<{
2399
- workflow: z.ZodOptional<z.ZodBoolean>;
2400
- batchCounts: z.ZodOptional<z.ZodBoolean>;
2401
- }, z.core.$strip>>;
2398
+ includeWorkflow: z.ZodOptional<z.ZodBoolean>;
2399
+ includeBatchCounts: z.ZodOptional<z.ZodBoolean>;
2402
2400
  }, z.core.$strip>;
2403
2401
  type GetBankAccountsInput = z.infer<typeof getBankAccountsInputSchema>;
2404
2402
  type WorkflowInfo = {
@@ -2410,10 +2408,10 @@ type BatchCounts = {
2410
2408
  openCount: number;
2411
2409
  readyToSignCount: number;
2412
2410
  failedCount: number;
2413
- };
2411
+ } | null;
2414
2412
  type AccountWithOptionalFields = AccountSelectType & {
2415
- workflow?: WorkflowInfo;
2416
- batches?: BatchCounts;
2413
+ workflow: WorkflowInfo;
2414
+ batches: BatchCounts;
2417
2415
  };
2418
2416
  type GetBankAccountsOutput = {
2419
2417
  accounts: AccountWithOptionalFields[];
@@ -2512,14 +2510,14 @@ declare class BankServiceBase extends BankServiceBase_base {
2512
2510
  addPaymentsToBatch({ paymentsToBatch, }: {
2513
2511
  paymentsToBatch: SendPaymentInput[];
2514
2512
  }): Promise<IRPCResponse<{
2513
+ status: "FAILED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED" | null;
2515
2514
  id: string;
2516
2515
  createdAt: Date | null;
2517
2516
  updatedAt: Date | null;
2518
2517
  deletedAt: Date | null;
2518
+ accountId: string | null;
2519
2519
  batchPaymentInitiatedAt: Date | null;
2520
2520
  authorizationUrls: string[] | null;
2521
- status: "FAILED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED" | null;
2522
- accountId: string | null;
2523
2521
  statusReason: string | null;
2524
2522
  payments: PaymentInsertType[];
2525
2523
  metadata: BatchMetadata | null;
@@ -405,10 +405,8 @@ const updateAccountInputSchema = z.object({
405
405
  });
406
406
 
407
407
  const getBankAccountsInputSchema = z.object({
408
- includes: z.object({
409
- workflow: z.boolean().optional(),
410
- batchCounts: z.boolean().optional()
411
- }).optional()
408
+ includeWorkflow: z.boolean().optional(),
409
+ includeBatchCounts: z.boolean().optional()
412
410
  });
413
411
 
414
412
  const disconnectAccountInputSchema = z.object({
@@ -1011,13 +1009,15 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
1011
1009
  return this.handleAction(
1012
1010
  { data: input, schema: getBankAccountsInputSchema },
1013
1011
  { successMessage: "Bank accounts retrieved successfully" },
1014
- async ({ includes }) => {
1012
+ async ({ includeWorkflow, includeBatchCounts }) => {
1015
1013
  const accounts = await this._getAccounts();
1016
- const includeWorkflow = includes?.workflow ?? true;
1017
- const includeBatchCounts = includes?.batchCounts ?? false;
1018
1014
  const accountsWithOptionalFields = await Promise.all(
1019
1015
  accounts.map(async (a) => {
1020
- const result = { ...a };
1016
+ const result = {
1017
+ ...a,
1018
+ workflow: null,
1019
+ batches: null
1020
+ };
1021
1021
  if (includeWorkflow) {
1022
1022
  let status;
1023
1023
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@develit-services/bank",
3
- "version": "0.3.48",
3
+ "version": "0.3.50",
4
4
  "author": "Develit.io s.r.o.",
5
5
  "type": "module",
6
6
  "exports": {