(ctx context.Context, arg ListAIBridgeInterceptionsParams, prepared rbac.PreparedAuthorized)
| 915 | } |
| 916 | |
| 917 | func (q *sqlQuerier) ListAuthorizedAIBridgeInterceptions(ctx context.Context, arg ListAIBridgeInterceptionsParams, prepared rbac.PreparedAuthorized) ([]ListAIBridgeInterceptionsRow, error) { |
| 918 | authorizedFilter, err := prepared.CompileToSQL(ctx, regosql.ConvertConfig{ |
| 919 | VariableConverter: regosql.AIBridgeInterceptionConverter(), |
| 920 | }) |
| 921 | if err != nil { |
| 922 | return nil, xerrors.Errorf("compile authorized filter: %w", err) |
| 923 | } |
| 924 | filtered, err := insertAuthorizedFilter(listAIBridgeInterceptions, fmt.Sprintf(" AND %s", authorizedFilter)) |
| 925 | if err != nil { |
| 926 | return nil, xerrors.Errorf("insert authorized filter: %w", err) |
| 927 | } |
| 928 | |
| 929 | query := fmt.Sprintf("-- name: ListAuthorizedAIBridgeInterceptions :many\n%s", filtered) |
| 930 | rows, err := q.db.QueryContext(ctx, query, |
| 931 | arg.StartedAfter, |
| 932 | arg.StartedBefore, |
| 933 | arg.InitiatorID, |
| 934 | arg.Provider, |
| 935 | arg.ProviderName, |
| 936 | arg.Model, |
| 937 | arg.Client, |
| 938 | arg.AfterID, |
| 939 | arg.Offset, |
| 940 | arg.Limit, |
| 941 | ) |
| 942 | if err != nil { |
| 943 | return nil, err |
| 944 | } |
| 945 | defer rows.Close() |
| 946 | var items []ListAIBridgeInterceptionsRow |
| 947 | for rows.Next() { |
| 948 | var i ListAIBridgeInterceptionsRow |
| 949 | if err := rows.Scan( |
| 950 | &i.AIBridgeInterception.ID, |
| 951 | &i.AIBridgeInterception.InitiatorID, |
| 952 | &i.AIBridgeInterception.Provider, |
| 953 | &i.AIBridgeInterception.Model, |
| 954 | &i.AIBridgeInterception.StartedAt, |
| 955 | &i.AIBridgeInterception.Metadata, |
| 956 | &i.AIBridgeInterception.EndedAt, |
| 957 | &i.AIBridgeInterception.APIKeyID, |
| 958 | &i.AIBridgeInterception.Client, |
| 959 | &i.AIBridgeInterception.ThreadParentID, |
| 960 | &i.AIBridgeInterception.ThreadRootID, |
| 961 | &i.AIBridgeInterception.ClientSessionID, |
| 962 | &i.AIBridgeInterception.SessionID, |
| 963 | &i.AIBridgeInterception.ProviderName, |
| 964 | &i.AIBridgeInterception.CredentialKind, |
| 965 | &i.AIBridgeInterception.CredentialHint, |
| 966 | &i.VisibleUser.ID, |
| 967 | &i.VisibleUser.Username, |
| 968 | &i.VisibleUser.Name, |
| 969 | &i.VisibleUser.AvatarURL, |
| 970 | ); err != nil { |
| 971 | return nil, err |
| 972 | } |
| 973 | items = append(items, i) |
| 974 | } |
nothing calls this directly
no test coverage detected