* Checks if a procedure should be included based on slicing configuration.
(options: ClientOptions<SchemaDef>, procedureName: string)
| 574 | * Checks if a procedure should be included based on slicing configuration. |
| 575 | */ |
| 576 | function isProcedureIncluded(options: ClientOptions<SchemaDef>, procedureName: string): boolean { |
| 577 | const slicing = options.slicing; |
| 578 | if (!slicing) { |
| 579 | // No slicing config, include all procedures |
| 580 | return true; |
| 581 | } |
| 582 | |
| 583 | const { includedProcedures, excludedProcedures } = slicing; |
| 584 | |
| 585 | // If includedProcedures is specified (even if empty), only include those procedures |
| 586 | if (includedProcedures !== undefined) { |
| 587 | if (!(includedProcedures as readonly string[]).includes(procedureName)) { |
| 588 | return false; |
| 589 | } |
| 590 | } |
| 591 | |
| 592 | // Then check if procedure is excluded (exclusion takes precedence) |
| 593 | if (excludedProcedures && excludedProcedures.length > 0) { |
| 594 | if ((excludedProcedures as readonly string[]).includes(procedureName)) { |
| 595 | return false; |
| 596 | } |
| 597 | } |
| 598 | |
| 599 | return true; |
| 600 | } |
| 601 | |
| 602 | function createModelCrudHandler( |
| 603 | client: ClientContract<any>, |